问题
I require one section to be "hidden". As i have links that "silentMove" to the slides in the section.
I have tried to use the following with no luck data anchor is "investments":
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');
}
},
Only solution i could come up with was:
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');
}
This is a shorter code, but you can not leave section 5, once you enter with silent move to:
afterLoad: function(anchorLink, index){
document.body.style.overflow = "hidden";
document.body.className += " no-scroll";}
https://jsfiddle.net/4wvwjrta/6/
来源:https://stackoverflow.com/questions/50228319/fullpage-js-disable-vertical-scroll-on-section