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

moveTo within onLeave #2052

Open
tschortsch22 opened this issue Jun 2, 2016 · 5 comments
Open

moveTo within onLeave #2052

tschortsch22 opened this issue Jun 2, 2016 · 5 comments

Comments

@tschortsch22
Copy link

Hi Alvaro,

since v2.8.1 it seems the method "moveTo" is not working within callback "onLeave".

onLeave: function(index, nextIndex, direction){
    var leavingSection = $(this);
        if(index == 2 && direction == 'down'){
        $.fn.fullpage.moveTo(4);
    }
}

With above code nothing happens in section 2, cannot scroll down to section 3 or 4...
Am I missing something or is this somehow a bug?

@alvarotrigo
Copy link
Owner

alvarotrigo commented Jun 2, 2016

Please provide an isolated reproduction of the issue in jsfiddle or codepen.
Working as expected here.

@alvarotrigo
Copy link
Owner

alvarotrigo commented Jun 2, 2016

I misread it.
I see what you mean now, but actually that is not working since 2.7.9.

Here's a solution for the moment:

http://jsfiddle.net/97tbk/1292/

//IE < 10 pollify for requestAnimationFrame
window.requestAnimFrame = function(){
    return window.requestAnimationFrame ||
        window.webkitRequestAnimationFrame ||
        window.mozRequestAnimationFrame ||
        window.oRequestAnimationFrame ||
        window.msRequestAnimationFrame ||
        function(callback){ callback() }
}();


$('#fullpage').fullpage({
    sectionsColor: ['yellow', 'orange', '#C0C0C0', '#ADD8E6'],
    onLeave: function(index, nextIndex, direction) {
        var leavingSection = $(this);
        requestAnimFrame(function(){
            if (index == 2 && direction == 'down') {   
                $.fn.fullpage.moveTo(4);
            }
        });
    }
});

@alvarotrigo alvarotrigo changed the title onLeave - moveTo moveTo within onLeave Jun 2, 2016
@tschortsch22
Copy link
Author

Ok, thank you for your help!

It was working in 2.7.9 without any problems, so will it be working in a future release?

@alvarotrigo
Copy link
Owner

alvarotrigo commented Jun 2, 2016

It was working in 2.7.9 without any problems

This jsfiddle proves it didn't. It is using 2.7.9.

so will it be working in a future release?

If I get to find a good solution for it, yes. Otherwise nop :)

@alvarotrigo alvarotrigo reopened this Jun 2, 2016
@tschortsch22
Copy link
Author

Ok, I'm sorry! I tested with this CDN link https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.7.9/jquery.fullPage.min.js.
Now I took a closer look at the file and it is v2.7.8!

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