JQuery - .position isn't returning offset relative to parent.

Posted by Spines on Stack Overflow See other posts from Stack Overflow or by Spines
Published on 2010-05-16T02:47:04Z Indexed on 2010/05/16 2:50 UTC
Read the original article Hit count: 205

Filed under:

I'm using .position to find the offset of where the element is relative to the parent, however it seems to be returning a value that is the offset from some parent up the ancestor tree.

I have a button, and its wrapped withing a div and its the only element of that div. The div is floated right. .position is returning a value like {left:780, top:370}, when the true value should be around {left:200, top:0}.

I'm using jquery 1.4

© Stack Overflow or respective owner

Related posts about jQuery