inorganik / angular-scroll-spy

A simple, lightweight scroll-spy directive for angular that was built from scratch.
http://inorganik.github.io/angular-scroll-spy/
MIT License
17 stars 10 forks source link

change offsetTop #4

Open brab0 opened 7 years ago

brab0 commented 7 years ago

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.