fidoboy
fidoboy

Reputation: 1059

using jQuery to get absolute or relative position position of a div

I'll try to explain what i'm trying to get. I've a div with position:fixed (at the bottom of a page) into that div, there is some other divs. What i want is to show another div (with absolute position) aligned to the right with those divs... in other words, i wan't to know the left position of the divs...

Upvotes: 6

Views: 22872

Answers (2)

Eric
Eric

Reputation: 97565

Relative to the document:

$('#ID').offset().left

Relative to its offset parent:

$('#ID').position().left

Upvotes: 20

ChaosPandion
ChaosPandion

Reputation: 78262

$('#ID').position().left

Upvotes: 2

Related Questions