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

Trying to insert this pluginin in to jquery cycle2 #2

Closed
ghost opened this issue Mar 6, 2015 · 1 comment
Closed

Trying to insert this pluginin in to jquery cycle2 #2

ghost opened this issue Mar 6, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 6, 2015

I'm trying to integrate this plugin with the plugin - jquery cycle2. (http://jquery.malsup.com/cycle2/)
I used the file jquery.scrollsteps-full-min.js. ( https://github.com/amondit/jquery.scrollsteps.js/blob/gh-pages/jquery.scrollsteps-full-min.js ).

That's how I call the plugin:

$(function() {

    var $slider = $('.slider_overlay');

    // slider initialize
    $slider.cycle({
        fx: 'scrollVert',
        timeout: 0,
        pager: '.slider_list',
        pagerTemplate: '',
        pagerActiveClass: 'active_slide',
        slides: '> div',
        centerHorz: true,
        centerVert: true,
        speed: 1000
    });

    // initialize scrollsteps plugin
    $slider.scrollsteps({
        up: $slider.cycle('prev'),
        down: $slider.cycle('next')
    });

});

And, when I start to scroll the page up and down, I get the following error message from firebug console:
"TypeError: i.down is not a function" or "TypeError: i.up is not a function"

Perhaps someone has any ideas or thoughts why this error may occur?

If I use a default mousewheel init (without scrollsteps plugin) - everything worked fine:

$slider.mousewheel(function(e) {
    if (e.deltaY > 0) {
        $slider.cycle('prev');
    } else {
        $slider.cycle('next');
    }
});

but it triggers a lot of scrolling events.

Maybe I'm solve this problem incorrectly ? If somebody knows other solutions - will be very grateful for the help.

@ghost
Copy link
Author

ghost commented Mar 10, 2015

Аnswer )

$(function() {
    var $slider = $('.slider_overlay');

    $slider.cycle({
        fx: 'scrollVert',
        timeout: 0,
        pager: '.slider_list',
        pagerTemplate: '',
        pagerActiveClass: 'active_slide',
        slides: '> div',
        centerHorz: true,
        centerVert: true,
        speed: 1000
    });

    function prev() {
        $slider.cycle('prev')
    }

    function next() {
        $slider.cycle('next')
    }

    $slider.scrollsteps({
        up: prev,
        down: next
    });
});

@ghost ghost closed this as completed Mar 10, 2015
This issue was closed.
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

0 participants