/ Published in: jQuery
courtesy Jean-Baptiste Jung
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function rPosition(elementID, mouseX, mouseY) { var offset = $('#'+elementID).offset(); var x = mouseX - offset.left; var y = mouseY - offset.top; return {'x': x, 'y': y}; }