jQuery Cycle create Conditional Statement
hi
as in my previous post I solved my own problem on handling the 'height' property, now I just can not make the conditional logic on onAfter statement
I make 4 sliders in the same page with
next-prev button on each slider
I put this on onAfter
- function onAfter(curr, next, opts, fwd) {
- var index = opts.currSlide;
- $('#prev,#prev2,#prev3,#prev4,#prev5')[index == 0 ? 'hide' : 'show']();
- $('#next,#next2,#next3,#next4,#next5')[index == opts.slideCount - 1 ? 'hide' : 'show']();
- //get the height of the current slide
- var $ht = $(this).height();
- //set the container's height to that of the current slide
- $(this).parent().animate({height: $ht},500);
- }
but everytime I click next or prev on first slide, the other next-prev button on other slide is affected too.
how to make conditional if statement so that the button on other slider not affected by other button
thanks