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

Event "scrollend" with delay #80

Open
xmon opened this issue Apr 8, 2017 · 1 comment
Open

Event "scrollend" with delay #80

xmon opened this issue Apr 8, 2017 · 1 comment

Comments

@xmon
Copy link

xmon commented Apr 8, 2017

Hi @kirkas

The "scrollend" event is delayed in a certain circumstance.

To play it, if you set "queued" to "y" and we are on one floor and we want to go to another floor that is on the same "y" axis. The "scrollend" event is launched with a delay of 1 or 2 seconds.

With the same configuration "queued" in "y", if we are on one floor and we want to go to another floor that is not in the same axis "y" and therefore has to move by 2 axes, the event "scrollend" Is launched without delay, at the same time that the animation ends.

Any idea to solve it?

thanks a lot

@xmon
Copy link
Author

xmon commented Apr 8, 2017

This is my workaround in my own code

        $(".links-to-floor li").click(function (event, index) {
        
            // here your check if need redefine "queued"
            if(...){
                    ascensorInstance.options.queued = "y";
            } else {
                    ascensorInstance.options.queued = "x";
            }
            ascensorInstance.scrollToFloor($(this).index());
        });

I have checked the source and the destination, to know which configuration for "queued" is needed, here a very basic example:

         var current = ascensor.data("current-floor");
         var destination = $(this).index();
         // for example
         if(current === 0 && destination === 6){
                    ascensorInstance.options.queued = "y";
         }

I hope it helps, as long as this BUG is not solved in the plugin.

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

No branches or pull requests

1 participant