微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jquery – 当灯箱打开时停止fullpage.js滚动,然后在灯箱关闭时重新启用

所以我在我正在使用的网站上使用fullpage.js.我有一个部分包含使用Nivo灯箱在灯箱中打开的团队领导的生物.当您点击此人时,他们的灯箱会打开,但如果您滚动浏览他们的信息(在移动设备中发生),则该部分会滑动.

我从fullpage.js找到了这个功能

$.fn.fullpage.setAllowScrolling(false);
$.fn.fullpage.setKeyboardScrolling(false);

当Nivo LightBox打开/关闭调用功能时,是否有可以测试的事件?

这里的例子:
http://jeffreyroche.us/solarTestBed/#team/2
点击某人然后向上滚动.

解决方法

您应该使用fullpage.js插件normalScrollElements选项:

normalScrollElements: (default null) If you want to avoid the auto scroll when scrolling over some elements,this is the option you need to use. (useful for maps,scrolling divs etc.) It requires a string with the jQuery selectors for those elements. (For example: normalScrollElements: ‘#element1,.element2’)

您可能需要根据灯箱标记修改normalScrollElementsTouchThreshold的值:

normalScrollElementTouchThreshold : (default 5) Defines the threshold for the number of hops up the html node tree Fullpage will test to see if normalScrollElements is a match to allow scrolling functionality on divs on a touch device. (For example: normalScrollElementTouchThreshold: 3)

您拥有fullpage documentation所需的所有信息.

如果需要更多控制,可以始终使用fullpage.js方法setAllowScrolling来允许autoScrolling或禁用它.这样,您可以在打开弹出窗口时禁用它,例如,关闭它后再次启用它.

原文地址:https://www.jb51.cc/jquery/177352.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐