Identifying & locating mouse position in jQuery


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $("#someDiv").click(function(e){
  2. var relativeX = e.pageX - this.offsetLeft;
  3. var relativeY = e.pageY - this.offsetTop;
  4. });

URL: http://jquery-howto.blogspot.com/2009/07/identifying-locating-mouse-position-in.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.