jQuery Cycle Plugin with typewriter transition effect

微笑、不失礼 提交于 2019-12-06 20:42:21

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>

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.

Why not just use the plugin you referenced? Doesn't look like the Cycle plugin was built for type-writer effects.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!