javascript - Yelp mouse tracking mechanism -
i realized yelp.com kind of tracking when mouse move or happens (click in element). how this? there library? how without 0 performance impact?
you can see console in firebug below:

a basic implementation of mouse tracking this: http://jsfiddle.net/pksah/
html:
<body> <div id="container"></div> </body> js:
currentposition = null; $("#container").on("mousemove", function (event) { currentposition = event; }); setinterval(function () { console.log(currentposition.pagex + "," + currentposition.pagey); }, 1000) css:
#container { width:100%; height:300px; background:yellow; }
Comments
Post a Comment