views:

210

answers:

1

Hay Guys, I'm using the Cycle plugin for a gallery. The plugin has a function that can be run after an image has been show

prevNextClick: function(isNext, zeroBasedSlideIndex, slideElement){
    SlideIndex = zeroBasedSlideIndex + 1;
    $(".count .c").empty().append(SlideIndex);
},
after: function(currSlideElement, nextSlideElement, options, forwardFlag){
    console.log(currSlideElement);
}

The prevNextClick function has a variable zeroBasedSlideIndex to determine which image is being displayed, howver the next function doesnt. I want to get the index of the element so i can display that in my HTML.

Any ideas?

+1  A: 

You can use options.nextSlide:

after: function(currSlideElement, nextSlideElement, options, forwardFlag){
    $(".count .c").empty().append(options.nextSlide);
}
PetersenDidIt
THanks, works a treat!
dotty