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
2009-03-25 21:33:03
very helpful thanks. this works greate
Danny G
2010-07-21 20:09:45