Question

Am using malsup cycle slider with after callback option it shows error like this

ReferenceError: onAfter is not defined
after:   onAfter,

i called even correctly

 $('#slider').cycle({ 
        fx: 'scrollHorz',
        pager: '.sli_nav',
        next:   '#nxt', 
        prev:   '#prev',
        after:   onAfter, 
         timeout: 0

   });

is there anything i missed.?

Was it helpful?

Solution

Please add the onAfter javascript function to your code like:

function onAfter(curr, next, opts) {
    var index = opts.currSlide;
    $('#prev')[index == 0 ? 'hide' : 'show']();
    $('#next')[index == opts.slideCount - 1 ? 'hide' : 'show']();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top