I have the code:
$(document).ready(function(){ $(this).movemouse(function(e){ console.log("X: " + e.pageX+" Y: "+e.pageY); }) })
I need the coordinates to be displayed on the console every 2 minutes, and not all the time while moving the mouse. Is it possible and in what direction to dig?
I tried setInterval()
, but I did not achieve anything.
Second attempt:
$(document).ready( function(){ var x=50; var y = 100; $(this).mousemove( function(e){ x = e.pageX; y = e.pageY; setInterval( function(){ console.log(x,y); }, 5000); }) })
$(document).ready(function(){ var x=50; var y = 100; $(this).mousemove(function(e){ x = e.pageX; y = e.pageY; setInterval(function(){ console.log(x,y); },5000); }) })
- XTreme95