我正在尝试准确记录鼠标在网页上的移动位置(到像素)。我有以下代码,但结果数据存在差距。
var mouse = new Array();
$("html").mousemove(function(e){
mouse.push(e.pageX + "," + e.pageY);
});
但是,当我查看记录的数据时,这是我所看到的一个示例。
76,2 //start x,y
78,5 //moved right two pixels, down three pixels
78,8 //moved down three pixels
这最好看起来更像:
76,2 //start x,y
77,3 //missing
78,4 //missing
78,5 //moved right two pixels, down three pixels
78,6 //missing
78,7 //missing
78,8 //moved down three pixels
有没有更好的方法来逐像素存储鼠标移动数据?我的目标对于网页来说太不切实际了吗?