alvarotrigo / react-fullpage

Official React.js wrapper for fullPage.js https://alvarotrigo.com/react-fullpage/
GNU General Public License v3.0
1.29k stars 178 forks source link

Determine when user scrolls to bottom of section when scrollOverflow={true} #373

Closed madeline-petersen closed 1 year ago

madeline-petersen commented 1 year ago

Is there a way to determine when a user has hit the bottom of a scrollOverflow section? Normally I would compare the scroll position to the height of the scroll area, but I can't find a way to get the height of the scroll area.

          onScrollOverflow={(section, slide, position, direction) => {
            // how can I get the max value of position to compare against?
            console.log("position", position);
          }}
alvarotrigo commented 1 year ago

You can probably use the beforeLeave callback for that.

Or you can just get the height of the scrollable section and check by yourself if you reached the bottom: https://stackoverflow.com/a/876134/1081396

The scrollable element is the on with the selector fp-overflow.

madeline-petersen commented 1 year ago

Got it, thank you!

alvarotrigo commented 1 year ago

Glad it helped!