Here is my code:
$(document).mousemove(function(e){
var $width = ($(document).width())/255;
var $height = ($(document).height())/255;
var $pageX = e.pageX / $width;
var $pageY = e.pageY / $height;
$("body").css("background-color", "rgb("+$pageX+","+$pageY+","+$pageX+")");
});
This kind of work, except that mousemove does not seem to be updated every time it moves. It seems to be lagging, are there any settings that I am missing? Pages x and page y are multiplied by the relative size of the documents up to 255, so the whole spectrum is used. Thank.
source
share