单个滑动延迟//超级滑动 [英] Individual slide delay // Superslides

查看:104
本文介绍了单个滑动延迟//超级滑动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是来自nicinabox Github Link 的超级市场的​​问题

This is a problem with superslides from nicinabox Github Link

我知道你可以使用'play'选项来设置一个时间,以毫秒为单位,然后自动进入下一张幻灯片。这为整个幻灯片设置了一个全球时间。

I know that you can use the 'play' option in order to set a time in milliseconds before progressing to the next slide automatically. This sets a global time for the entire slideshow.

我想要实现的是单个幻灯片有自己的特定进度/延迟时间。
例如,如果我有一张包含20张幻灯片的幻灯片,我希望所有幻灯片自动进展并在屏幕上停留5秒钟。但是第三张幻灯片应显示20秒。

What I would like to achieve is for individual slides to have their own specific progress/delay time. For example if I have a slideshow with twenty slides I want all the slides to progress automatically and to stay on screen for 5 seconds. However the third slide should be displayed for 20 seconds.

我试图通过使用animated.slides事件来做到这一点,但我不能让它在动画停止时工作第四张幻灯片:

I have tried to do this by using the animated.slides event but I cant get it to work as the animation stops with the fourth slide :

这是我的代码:

$(function () {
  $('#slides').superslides({

      hashchange: true,
      play: 5000,
      pagination: true
  });


});

$('#slides').on('animated.slides', function () {
  var current_index = $(this).superslides('current');

  if (current_index === 2) { // third slide

      $(this).superslides('stop');

      var disp = function test1() {

          setTimeout(function ()

              {
                  $('#slides').superslides('animate', 3)
              }, 20000);

      }
      disp();

  }

});

任何帮助将不胜感激。也许有人在那里解决我的问题。

Any help would be appreciated. Maybe there is someone out there to solve my problem.

推荐答案

替换 .superslides('animate', 3) .superslides('start')

演示(条件是2,正如你最初写的那样)

Demo (the condition is 2, as you originally wrote)

这篇关于单个滑动延迟//超级滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆