[英]I want to add an event listener to an element which gets fired when the corresponding elements is scrolled into the view
How can I add such an event listener to an element? 如何将这样的事件侦听器添加到元素? My motive is to highlight elements in nav bar when the page is scrolled into the corresponding section.
我的动机是当页面滚动到相应部分时,突出显示导航栏中的元素。 Thanks
谢谢
There is a plugin i used several times which fit you needs: 我使用了几次适合您需要的插件:
or 要么
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.