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. });


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.