I have been looking for this for awhile however the links to the code and tutorial are no longer valid. Does anyone have the code they can share? It would be greatly appreciated!
It’s been a bit since I worked on this, and me and him did it in a slightly different way, but the way I did it was having a container at the bottom of each section, 10 pixels off the bottom.
Then I had this code:
let midScroll = false;
$w.onReady(function () {
//nedscroll kode
$w("#section1").onViewportEnter(handler=>{
enterOne()
})
$w("#section2").onViewportEnter(handler=>{
enterTwo()
})
$w("#section3").onViewportEnter(handler=>{
enterThree()
})
$w("#section4").onViewportEnter(handler=>{
enterFour()
})
//oppscroll kode (The bottomOf are the containers at the bottom of the pages)
$w("#bottomOf1").onViewportEnter(handler=>{
enterOne()
})
$w("#bottomOf2").onViewportEnter(handler=>{
enterTwo()
})
$w("#bottomOf3").onViewportEnter(handler=>{
enterThree()
})
$w("#bottomOf4").onViewportEnter(handler=>{
$w("#section2").collapse()
$w("#section3").collapse()
enterOne()
$w("#section2").expand()
$w("#section3").expand()
})
});
Then I had this type of code for each of the enterOne/enterTwo and so on:
To prevent some of the double-scrolling that I experienced.
But as I said, it’s been a while since I worked on this, but it might point you in the right direction. (Remember that each section needs to be 100vh!)