Detect mouse position in jQuery

To detect where the mouse was on the page we have to do is to read event object’s .pageX and .pageY properties.

   // e.pageX - gives you X position
   // e.pageY - gives you Y position
     mouseX = e.pageX;
     mouseY = e.pageY;  
 }); })
Share this nice post:

Leave a Reply

Your email address will not be published. Required fields are marked *