简体   繁体   English

Zurb Foundation轨道滑块在第三张幻灯片上暂停

[英]Zurb Foundation Orbit Slider Pause on 3rd Slide

I added animation speeds, and can pause on hover; 我增加了动画速度,可以在悬停时暂停; however, I was curious if with JS I am able to pause on a certain slide, or at least a certain time. 但是,我很好奇,如果使用JS,我是否能够在某个幻灯片或至少某个时间暂停。 Any suggestions how this might be possible? 有什么建议怎么可能吗?

thanks! 谢谢!

The orbit js dispatches events when the slide changes 'orbit.next' 'orbit.prev'... 当幻灯片更改为'orbit.next''orbit.prev'时,orbit js调度事件...

  //from the orbit js
  this.$element.bind('orbit.next', function () {
    self.shift('next');
  });

  this.$element.bind('orbit.prev', function () {
    self.shift('prev');
  });

you can listen to these events with jQuery, eg. 您可以使用jQuery听这些事件,例如。

$("#featured").bind('orbit.next orbit.prev', function(event){
      console.log('slide change', event);
  });

Not sure how you would get the time, but you could alter the orbit js to expose the info you need. 不知道如何获得时间,但是您可以更改orbit js以显示所需的信息。

To get the slide number you could enable the 'slideNumber' option 要获取幻灯片编号,您可以启用“ slideNumber”选项

slideNumber: true,               // display slide numbers?

and get the number from the display. 并从显示屏上获取号码。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM