Prototype Equivalent JQuery's offset()
I would like to know if there开发者_StackOverflow社区 is any prototype equivalent to the JQuery's .offset() function?
Thanks for your help.
jQuery's offset (element position relative to document) maps to Element.cumulativeOffset
similarly, jQuery's position (element position relative to offset parent) maps to Element.positionedOffset
If you are looking for offset relative to document, go for:
Element.cumulativeOffset
If you are looking for offset relative to an element however, go for:
Element.Offset
.
精彩评论