How to identify the x axis and y-axis of particluar element using jquery. Like we use pageX and pageY to identify the mouse pointer's position.
+2
A:
there is position()
function that return Object{top,left}
var p = $("p:first");
var position = p.position();
var left = position.left;
var top = position.top;
Anwar Chandra
2009-12-28 09:29:45
position() is relative to the offset element not the page (like pageX and pageY on events). offset() is the better fit here.
cletus
2009-12-28 09:56:47