实现 Coda 滑块停止/暂停/播放按钮

发布于 12-22 08:30 字数 251 浏览 4 评论 0原文

我正在尝试在网站的主页上实现 Coda Slider,而我的负责人要求提供停止按钮,但关于此事的文档很少甚至没有。以前有人遇到过这个问题吗?

Coda 滑块:http://www.ndoherty.biz/
我的网站:http://enguita.info

I am trying to implement Coda Slider on a website's homepage and the person I'm doing it for asked for a stop button, but there is little to no documentation on the matter. Has anyone faced this issue before?

Coda Slider: http://www.ndoherty.biz/
My website: http://enguita.info

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

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

发布评论

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

评论(1

追星践月2024-12-29 08:30:36

在 Coda-Slider 文档的评论部分找到了这个:

emceehao 写道: 嗨,这是一个令人惊叹的滑块。但我想阻止
循环,可能吗?

代码:

函数 autoSlide() {
   if (navClicks == 0 || !settings.autoSlideStopWhenClicked) {
      if (当前面板 == 面板计数) {
         返回假; ////////添加这一行////////////
         变量偏移量 = 0;
         当前面板=1;
      } 别的 {...

简陋但有效。如果您希望有些人这样做而有些人不这样做,请添加
进入设置数组,如“stopAtEnd”并对其进行测试,如
if(settings.stopAtEnd)

(PS 可以从另一个论坛发布答案吗...?)

Found this in the comments section of the Coda-Slider documentation:

emceehao wrote: hi, this is an amazing slider. but i want to stop the
loop, is it possible?

Code:

function autoSlide() {
   if (navClicks == 0 || !settings.autoSlideStopWhenClicked) {
      if (currentPanel == panelCount) {
         return false; ////////add this line///////////
         var offset = 0;
         currentPanel = 1;
      } else {...

crude but it works. if you want some to do it and some not, add an
entry to the settings array like "stopAtEnd" and test for it like
if(settings.stopAtEnd)

(PS is it OK to post an answer from another forum...?)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文