Skip to content

Replace offset() by position()#21

Open
cyrez wants to merge 1 commit intodrewwilson:masterfrom
cyrez:master
Open

Replace offset() by position()#21
cyrez wants to merge 1 commit intodrewwilson:masterfrom
cyrez:master

Conversation

@cyrez
Copy link

@cyrez cyrez commented Mar 26, 2015

The .position() method allows us to retrieve the current position of an element relative to the offset parent. Contrast this with .offset(), which retrieves the current position relative to the document. When positioning a new element near another one and within the same containing DOM element, .position() is the more useful. (cf. https://api.jquery.com/position/)

This prevents possible positioning issue if container manipulated by another script.

The .position() method allows us to retrieve the current position of an element relative to the offset parent. Contrast this with .offset(), which retrieves the current position relative to the document. When positioning a new element near another one and within the same containing DOM element, .position() is the more useful. (cf. https://api.jquery.com/position/)

This prevents possible positioning issue if container manipulated by another script.
@danimesq
Copy link

Hi, @JoomliC
I've forked TipTip to maintain it and use in all web projects of my community.
Please clone your pull request to: https://github.com/Software-js/TipTip
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants