jQuery Cycle plugin- How to return the index numbe

2020-07-06 03:57发布

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..

2条回答
男人必须洒脱
2楼-- · 2020-07-06 04:15

You can do this:

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

Hope it helps

查看更多
等我变得足够好
3楼-- · 2020-07-06 04:31

To get the current slide use:

before: function (curr, next, opts) {
    alert("Current slide " + opts.currSlide);
}
查看更多
登录 后发表回答