简体   繁体   English

如何自定义轨道字幕动画

[英]How to customize orbit-caption animation

I'm using Foundation 5 as my framework. 我正在使用Foundation 5作为框架。 I'm having a problem with changing the default animation and speed of the orbit-caption. 我在更改默认动画和轨道字幕的速度时遇到问题。

Is there anyone who knows how to change the animation from slide to fade for the captions? 有谁知道如何将字幕的动画从幻灯片更改为淡入淡出? and if there is, is it possible to do it using the attribute data-options? 如果有,是否可以使用data-options属性来实现?

I saw from the documentation that there are different ways to customize orbit slider but can't find anything about the caption. 我从文档中看到,有多种自定义轨道滑块的方法,但是找不到标题的任何内容。 I also tried looking for similar problems here in stackoverflow but can't find the same one as me. 我也尝试在stackoverflow中寻找类似的问题,但找不到与我相同的问题。 Hopefully you guys can help me. 希望你们能帮助我。 Thanks in advance 提前致谢

I manage to do it somehow by adding an event listener 我设法通过添加事件监听器来做到这一点

Here is how I did it: 这是我的做法:

$(".orbit-next, .orbit-prev").click(function() {
      $('.orbit-caption').fadeOut(100);
      $('.orbit-caption').fadeIn(1500);
});

or I can also use events provided from the documentation 或者我也可以使用文档中提供的事件

$("#banner").on("before-slide-change.fndtn.orbit", function(event) {
    $('.orbit-caption').fadeOut(100);
});
$("#banner").on("after-slide-change.fndtn.orbit", function(event, orbit) {
    $('.orbit-caption').fadeIn(1500);
});

If any of you have a better suggestion on how to do this properly, please do so. 如果您对如何正确执行此操作有更好的建议,请这样做。 I'd be really happy to learn something new :) 我很高兴学习新东西:)

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

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