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

Disable infinity scroll. #11

Open
mikeyakymenko opened this issue Sep 25, 2014 · 0 comments
Open

Disable infinity scroll. #11

mikeyakymenko opened this issue Sep 25, 2014 · 0 comments

Comments

@mikeyakymenko
Copy link

Hi, i have 2 problems.

  1. 3 slides. 1st is current, then i do one touch on Macbook, or android device, slides scrolls automaticly from 1 to 2 and to 3! Almost in one moment.

  2. And if i scroll to top, from 1st slide go to 3, reverse.

I need fix it.

My code:

$(document).ready(function() {
    $('body').mousewheel(function(event, delta) {
        if (delta < 0 ) {
            $("#nextpage").trigger("click");
        }
        else if (delta > 0) {
            $("#prevpage").trigger("click");
        }
        // e.stopPropagation();
        // e.preventDefault();
    });

    $("body").keydown(function(e) {
        if(e.keyCode == 37) { // left
            $("#prevpage").trigger("click");
        }
        else if(e.keyCode == 39) { // right
            $("#nextpage").trigger("click");
        }
    });
});

Any help?

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