具有打字机过渡效果的jQuery Cycle插件 [英] jQuery Cycle Plugin with typewriter transition effect

查看:92
本文介绍了具有打字机过渡效果的jQuery Cycle插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道是否有人知道如何使用jQuery Cycle插件实现打字机效果.

Wondering if anyone knows how to achieve a typewriter effect with the jQuery Cycle plugin.

请参见此处以获得所需的效果: http://www.hungry-media. com/code/jQuery/tickerType/

See here for desired effect: http://www.hungry-media.com/code/jQuery/tickerType/

谢谢. 戴夫

推荐答案

尝试使用Cycle的afterbefore过渡回调在显示的元素上调用其他插件.您将需要使用专用于类型效果的插件,例如效果jTypeWriter 来调用效果显示元素时.

Try using Cycle's after and before transition callbacks to invoke other plugins on the element being displayed. You'll need to use a plugin dedicated only to the type effect, like Effects jTypeWriter to invoke the effect when an element is displayed.

$("#cycle-pane").cycle({
  before: function() { $(this).jTypeWriter(); }
});

<div id="cycle-pane">
  <div>First text</div>
  <div>Second text</div>
</div>

您需要密切注意Cycle过渡的时间和类型效果的持续时间,以及如果Cycle在循环上运行可能需要进行的任何清理或重置.

You'll need to keep an eye on the timing of Cycle transitions and the duration of the type effect and also any cleanup or reset that may need to be done if Cycle is running on a loop.

这篇关于具有打字机过渡效果的jQuery Cycle插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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