angular-scroll
angular-scroll copied to clipboard
Scrollspy using visible percentage of the element calculation
Hello!
Thank you for this great plugin!
I'm looking into it in order to implement a scrollspy navigation bar. However, it's not working as I would like it to.
Right now, it uses a very primitive scroll offset algorithm in order to detect visible element. But, in order to achieve a better usability, I think it should use algorithm based on calculation of the visible part of the target element.
There are a lot of obvious situations where some element takes 90% of the display, but is not triggering scrollspy because browser's scroll offset has not reached it's top border. I think it's missleading to the user. I've tried to use the offset attribute, but it's not possible to achieve good results because responsive site can be viewed on different devices with different screen heights.
I hope it makes sense )
Hi @slavafomin, It should be solvable by changing the duScrollOffset value according to screen size. But it's limited in a way that you can only set the value once so it's not truly responsive.
This may be related to https://github.com/oblador/angular-scroll/pull/60