开发者

Can I pause SlidesJS on click?

开发者 https://www.devze.com 2023-04-06 13:55 出处:网络
I am using SlidesJS for a sl开发者_如何学Goideshow and I was wondering if there is a way to pause and play the slideshow on click of a button?I recommend grabbing the most current version from github

I am using SlidesJS for a sl开发者_如何学Goideshow and I was wondering if there is a way to pause and play the slideshow on click of a button?


I recommend grabbing the most current version from github looks like in this new version its as simple as calling stop() and play()

He has an example here showing how as well, notice the bottom left, has the option to play and stop.

http://beta.slidesjs.com/examples/standard/


Your required functionality will work in the Slides 2 beta, but not in any version below 2 you can check out how it works here : https://github.com/nathansearles/slides/


In your jquery.slides.js file do a search for _this.stop(true);

It shows about 3-4 times, next & previous click.. and you will also see it showing for paginationLink.click

The problem i was having was the slider was stop sliding after click either previous, next or pagination. I needed the slider to restart.. so what i did was add a setTimeout to play()

_this.stop(true);

setTimeout(function ()
{ _this.play(true) }, 3000);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号