jQuery Cycle create Conditional Statement

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

  1. function onAfter(curr, next, opts, fwd) {
  2. var index = opts.currSlide;
  3. $('#prev,#prev2,#prev3,#prev4,#prev5')[index == 0 ? 'hide' : 'show']();
  4. $('#next,#next2,#next3,#next4,#next5')[index == opts.slideCount - 1 ? 'hide' : 'show']();
  5. //get the height of the current slide
  6. var $ht = $(this).height();
  7. //set the container's height to that of the current slide
  8. $(this).parent().animate({height: $ht},500);
  9. }

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
    • Topic Participants

    • aikju