user1820898
user1820898

Reputation: 35

Get the position of an image using Jquery

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

Answers (1)

flow
flow

Reputation: 5048

.position gives the position relative to the parent .offset gives the position relative to the document

Upvotes: 2

Related Questions