Skip to content

change offsetTop#4

Open
brab0 wants to merge 1 commit into
inorganik:masterfrom
brab0:master
Open

change offsetTop#4
brab0 wants to merge 1 commit into
inorganik:masterfrom
brab0:master

Conversation

@brab0
Copy link
Copy Markdown

@brab0 brab0 commented Apr 21, 2017

I changed offsetTop function to target.getBoundingClientRect().top.
offsetTop gets the relative position of the parent node which, if we have a element wrapper, turns the value always 0 and never trigger the scroll-spy.

change offsetTop to target.getBoundingClientRect().top. offsetTop gets the relative position to the parent node, while target.getBoundingClientRect().top get to the document
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.

1 participant