My goal is to make the user scroll through 4 sections. Upon reaching the fourth section, if the user scrolls down again, instead of going to the fifth section, the view should loop back to the first section. (The fifth section only contains the imprint and can be accessed separately.)
This is the code I am using:
$('#fullpage').fullpage({
onLeave: function(index, nextIndex, direction){
if(nextIndex == 5){
$.fn.fullpage.moveTo(1);
}
}
});
This script is placed within the fourth section, but moving it around does not produce any changes.
The current situation is:
It is impossible to access the fifth section.
Even though scrolling to other sections is possible, they are not reachable via their anchors.
I am confused about what I might be doing wrong. Any feedback would be appreciated.