Reputation: 3642
Is this possible to get div element position in JQuery?
homebox is hidden and having right as 0px , I want to animate homebox to container.
so i tried this code
$("#homebox").animate({ left:$("container").position().left}, 500);
Upvotes: 0
Views: 97
Reputation: 10520
You can use either Offset or Position
Offset - Get the current coordinates of the first element in the set of matched elements, relative to the document.
Position - Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
Upvotes: 1