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

Parallax animation breaks if onLeave returns false #2906

Closed
dazjohnson opened this issue Sep 16, 2017 · 2 comments
Closed

Parallax animation breaks if onLeave returns false #2906

dazjohnson opened this issue Sep 16, 2017 · 2 comments

Comments

@dazjohnson
Copy link

dazjohnson commented Sep 16, 2017

Try the following with the parallax extension enabled:

var temp = false;

$('#whatever').fullpage({
    onLeave: function (index, nextIndex, direction) {  
                 if(temp == false){
                    temp = true;
                    return false;
                }else{
                    return true;
                }
    }
});

You'll notice that the background image no longer parallaxes.

Let me know if you're happy for me to do a codepen, but it will involve uploading the parallax lib.

@alvarotrigo
Copy link
Owner

alvarotrigo commented Sep 18, 2017

Thanks for reporting it!
Using return false within the onLeave callback will prevent the section to slide up or down, therefore there's no animation to be performed.

What I noticed is that scrolling down seems to work fine, just not doing anything, but when scrolling up again, keeping on the same section as it should, it applies the transformation to the background when it shouldn't, as the section stills the same and did not move at all.
This is supposing you use the default value of "type: 'reveal'"`. When using "type: 'cover'" the problem would occur when scrolling up instead of down.
Is this last problem the one you are referring to ?

@alvarotrigo
Copy link
Owner

alvarotrigo commented Oct 10, 2017

Fixed on the dev branch. Will get merged in 2.9.5.

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