FullPage.JS Scrolling

﹥>﹥吖頭↗ 提交于 2019-12-24 18:09:14

问题


My question involves fullpage.js responding to (window).scroll events. I'm trying to have my application change the navbar on a scroll, but I can't get my site to log any of the scroll events. I tried following questions like: Animate in Nav bar on scroll. When I add the autoScrolling: false option to fullpage, it remedies the issue, but I would rather not use that option. I want to take advantage of the simple scroll action moving the entire page.

I can provide a jsfiddle example if this is still unclear.


回答1:


You should better use the callbacks provided by the plugin such as onLeave and afterLoad. That would give you the power of firing actions when going from one to another slide.

If you still want to do it with other plugins, then you would need to use fullpage.js with the option scrollBar:true.

You have more information about it at the documentation.

The reason you can not fire any action by using the scroll event is because the plugin doesn't really scroll the page but just change the top property of the site wrapper or add the property translate3d in case of using the option css3:true.



来源:https://stackoverflow.com/questions/22139309/fullpage-js-scrolling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!