JS Full Page Scrolling?
- Started
- Last post
- 3 Responses
- mg33
Howdy.
Working on something with nice full page scrolling in mind, and wondering how you can have content within one of the scrolling sections that is taller than the viewport.
Consider this scenario:
Section 1 - content within fits within the viewport. Initiating scroll brings you to Section 2 and it snaps into place.
Section 2 - content is taller than the viewport, and should scroll freely within it until you're at the end, then it should scroll to Section 3, and it snaps into place.
Section 3 - could do either treatment from section 1 or section 2.Basically the general function of the example below, but with the capability I described in section 2.
https://alvarotrigo.com/fullPage…
Any thoughts? I don't know a ton about javascript so I'm interested in the tool above, trying to insert it into a site I'm building with Oxygen Builder.
- mg331
Ha - answered my own question. I'll drop this here in case anyone else is interested.
- sted0
check viewport height on load:
if fits
do scenario 1if doesn't fits
do scenario 2
also in wp you can tie these js functions without php to specific pages by observing the body class and building functions on that...
- monNom2
I bet you could hack around with the css 'sticky' property to do this without JS at all.
check demo on this page for a clue