Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear fitToSectionDelay when declaring setFitToSection(false) #4590

Open
Rasande opened this issue Nov 21, 2023 · 3 comments
Open

Clear fitToSectionDelay when declaring setFitToSection(false) #4590

Rasande opened this issue Nov 21, 2023 · 3 comments

Comments

@Rasande
Copy link

Rasande commented Nov 21, 2023

Is there a way to prevent a section to fit the screen when you declare fullpage_api.setFitToSection(false)
during the delay period of fitToSectionDelay? As of now you have to wait for the delay to run out before it's disabled.

Using the demo from the documentation https://codepen.io/alvarotrigo/pen/GJXNYm and reproduce the following steps:

  1. Scroll down to the middle of the page
  2. Press "Turn off" within the delay period

The closest section still scrolls to the top even though I would assume the function is disabled.

fullPage.js v4.0.20

@alvarotrigo
Copy link
Owner

Unfortunately, that's not possible at the moment.

Any reason why you can't just disable it before the user scrolls?

@Rasande
Copy link
Author

Rasande commented Nov 22, 2023

I understand, but thank you for the answer!

I was aiming to disable or enable it when the user scrolls past different parts of the page. But once it was enabled it had to fit to a section before it was disabled, no matter how long you scrolled for.

@alvarotrigo
Copy link
Owner

Maybe you can use the afterLoad callback or the onLeave callback for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants