Reputation: 35
I'm trying to get the position of an image using Jquery. The only problem is that it only gives me the position where the image where when the document loaded.
$(".frog").click(function(){
alert($(".frog").position().left);
});
How do I get the position of the image after it been moved?
/Johannes
Upvotes: 0
Views: 1903
Reputation: 5048
.position
gives the position relative to the parent
.offset
gives the position relative to the document
Upvotes: 2