Fullpage.js禁用垂直滚动部分

我要求一个部分“隐藏”。 因为我有链接“silentMove”到该部分中的幻灯片。

我试图使用以下没有运气数据锚是“投资”:

afterLoad: function(anchorLink, index){ if(index == 4 && slideAnchor == 'investments'){ $('body.fp-section.investments').find('.fp-slide').index(4,0); $.fn.fullpage.setAllowScrolling(false, 'down'); $.fn.fullpage.setKeyboardScrolling(false, 'down'); } }, 

我能提出的唯一解决方案是:

  afterLoad: function(anchorLink, index){ if(index == 4 && anchorLink == 'investment'){ $('body.fp-viewing-investment').find('.fp-section').index(); $.fn.fullpage.setAllowScrolling(false, 'down'); $.fn.fullpage.setKeyboardScrolling(false, 'down'); } if(index == 3 && anchorLink == 'section3'){ $('body.fp-viewing-section3').find('.fp-section').index(); $.fn.fullpage.setAllowScrolling(true, 'down'); $.fn.fullpage.setKeyboardScrolling(true, 'down'); } 

这是一个较短的代码,但是一旦你输入静默移动到,你就不能离开第5部分:

  afterLoad: function(anchorLink, index){ document.body.style.overflow = "hidden"; document.body.className += " no-scroll";} 

https://jsfiddle.net/4wvwjrta/6/