angular-scroll icon indicating copy to clipboard operation
angular-scroll copied to clipboard

Scrollspy using visible percentage of the element calculation

Open slavafomin opened this issue 10 years ago • 2 comments

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 )

slavafomin avatar Feb 25 '15 19:02 slavafomin

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.

oblador avatar Feb 26 '15 12:02 oblador

This may be related to https://github.com/oblador/angular-scroll/pull/60

cakesmith avatar Feb 26 '15 14:02 cakesmith