JQuery offset () prototype equivalent

I would like to know if there is any prototype equivalent to the JQuery.offset () function?

Thank you for your help.

+3
source share
2 answers

jQuery offset (element position relative to the document) is mapped to Element.cumulativeOffset

similarly, the jQuery position (element position relative to the offset parent) is displayed in Element.positionedOffset

+3
source

If you are looking for an offset relative to the document, go for:

Element.cumulativeOffset

If you are looking for an offset relative to an element, go for:

Element.Offset.

+2
source

Source: https://habr.com/ru/post/1759092/


All Articles