Thursday, July 24, 2008

Track mouse with jQuery

 

$(document).ready(function()
 {
  $().mousemove(function(e)
   {
    $('p').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);
  });
});

 

Source

1 comment:

  1. Its probably worth mentioning that e.clientX and e.clientY will give you the X and Y of the viewport.

    ReplyDelete