views:

14928

answers:

1

Is there a way of finding the absolute position of an element, i.e. relative to the start of the window, using jQuery?

+36  A: 

.offset() will return the offset position of an element as a simple object, eg:

var position = $(element).offset(); // position = { left: 42, top: 567 }

You can use this return value to position other elements at the same spot:

$(anotherElement).css(position)
Crescent Fresh
very helpful thanks. this works greate
Danny G