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

。_饼干妹妹 提交于 2019-12-05 20:08:09

问题


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


回答1:


You can do this:

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

Hope it helps




回答2:


To get the current slide use:

before: function (curr, next, opts) {
    alert("Current slide " + opts.currSlide);
}


来源:https://stackoverflow.com/questions/8276577/jquery-cycle-plugin-how-to-return-the-index-number-of-the-currently-displayed-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!