jQuery Cycle plugin- How to return the index number of the currently displayed slide?

Newcomer picture Newcomer · Nov 26, 2011 · Viewed 7.7k times · Source

I'm currently using Malsup's Cycle plugin . I am just wondering is it possible to have cycle plugin return the index number of the currently displayed slide??

I want to change the content of the page when a specific slide is active. Don't know how to achieve that..

Answer

Sudhir Bastakoti picture Sudhir Bastakoti · Nov 26, 2011

You can do this:

//on before function
before: function (curr, next, opts) {
    alert(opts.nextSlide + " of " + opts.slideCount);
} 

Hope it helps