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或禁用它.这样,您可以在打开弹出窗口时禁用它,例如,关闭它后再次启用它.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...