-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Skipping the animation when jumping more than one slide up/down #4643
Comments
I'm not sure if this is what you need, but I explained how to skip sections & slides on this article Here's the codepen: If you don't want the section/slide to be visible while scrolling, you can consider hiding it using CSS and fullpage.js will totally ignore it. |
Is this what you need? I used the beforeLeave: function (origin, destination, direction, trigger) {
if(origin.index !== destination.index -1 && origin.index !== destination.index + 1){
fullpage_api.setScrollingSpeed(0);
}else{
fullpage_api.setScrollingSpeed(700);
}
},
Can you clarify a bit more in which scenarios you'd like to skip the transition? I can only imagine things like:
|
Thanks! Setting the scrolling speed to 0 in these scenarios achieves the effect I was looking for. Though there are several ways to navigate to sections that aren't immediate siblings (keyboard shortcuts, changing the URL hash), the one that our users mostly encounter is a custom "bullet" navigation. You can see it in this demo by clicking the 3rd bullet when on the 1st section. This isn't a huge deal when you have a few sections, but ours has 62! So, we want to skip the sliding up animation when jumping from, say, the 1st section to the 10th. For what it's worth, I think this would be a natural default for fullPage.js, or at least an option that's built-in. Anyway, thanks for the tip! This works well enough for us. :) |
Yeap, good point 👍 |
…on when jumping non consecutive sections/slides #4643
I've added this feature in fullpaeg.js 4.0.27! 🥳 The option is called |
Thanks! That's fantastic. Can you think of any reason why this wouldn't work with the React package? I updated my dependencies, I can see that fullpage.js version 4.0.27 is installed, yet, adding |
I haven't released a new version for React yet with the update :) |
No rush, but do you have an ETA on when this will be available in the React build? |
Published it just now! 🥳 |
Can fullPage.js be configured to skip the animation when navigating to a section that is not immediately before/after the current slide?
I've tried a couple of ways to accomplish this. For example, with custom navigation, I can compare the desired section's index against the current index and use
silentMoveTo
to skip the animation. But this doesn't work if the navigation is triggered another way (e.g., manually changing the URL's fragment or using a keyboard shortcut that jumps more than up/down).I also tried using
beforeLeave
like this:But it doesn't quite work.
I think this would be a fantastic built-in option. Something like
scrollToNonSiblings = false
or something.Or, if there was a way to return a string or boolean in
beforeLeave
that corresponds to the effect to use.The text was updated successfully, but these errors were encountered: