有什么方法可以让 jQuery 循环在到达结束或开始时不循环?

发布于 2024-11-27 23:05:29 字数 149 浏览 5 评论 0原文

我意识到该插件称为 CYCLE,因为它循环列表的元素。但我最喜欢它的是它的灵活性,所以我想知道是否有什么方法可以让插件不循环。因此,如果您尝试在第一张幻灯片上转到上一张幻灯片,或在最后一张幻灯片上转到下一张幻灯片,它就会停止。

我一直在阅读选项和代码,但找不到解决方案

I realize that the plugin is called CYCLE because it cycles throgh the element of the list. But what I like most about it is its flexibility, so I was wondering if there is any way to make the plugin not cycle. So if you try to go to the previous slide when on the first one, or to the next slide when on the last one, it just stops.

I've been reading through the options and the code but cant find the solution

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

醉酒的小男人 2024-12-04 23:05:29

http://jquery.malsup.com/cycle/options.html

查看<代码>nowrap 属性。 (请参阅http://jquery.malsup.com/cycle/nowrap2.html)设置将其设置为 nowrap: 1,每张幻灯片播放 1 次后,您的节目就会停止。这显然是您需要的选项。

http://jquery.malsup.com/cycle/options.html

Check out the nowrap property. (See http://jquery.malsup.com/cycle/nowrap2.html) Set it to nowrap: 1 and your show will stop after each slide has been played 1 time. This is clearly the option you'd need.

谈场末日恋爱 2024-12-04 23:05:29

使用此滑块: http://slidesjs.com/

Slides.js 中的 y() 函数会暂停滑块。因此,如果您想停止在幻灯片 4 上...

animationComplete: function(current){ 
    if(current == 4) { 
      y();  
    } else {    
      /* default animate slide code */
    };                       
},

Using this slider: http://slidesjs.com/

The y() function in the slides.js pauses the slider. So if you wanted to stop on slide 4...

animationComplete: function(current){ 
    if(current == 4) { 
      y();  
    } else {    
      /* default animate slide code */
    };                       
},
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文