I'm using fullpage.js and was wondering how I would go about preventing the user from scrolling back to the initial (first) slide after they've scrolled past it?
I still want to be able to scroll between all subsequent slides as intended, but essentially remove the first slide once past it so that it cannot be scrolled back up (basically making the second slide the first, as if the first is no longer there).
Hopefully this makes sense? The first slide is basically an intro/video slide and I only want it shown on initial page load, then after scrolled passed for it to no longer be accessible.
Just use setAllowScrolling
whenever you arrive to the 2nd section:
$('#fullpage').fullpage({
afterLoad: function(anchorLink, index){
//on load section 2...
if(index == 2){
$.fn.fullpage.setAllowScrolling(false, 'up');
}else{
$.fn.fullpage.setAllowScrolling(true, 'up');
}
}
});
Demo online
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With