views:

1910

answers:

2

Hey,

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

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

Thanks. Dave

A: 

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

Jonathan Sampson
I'm using some of the advanced pager functionality of the cycle plugin, and various other things that the cycle plugin can handle which others I find cannot.Plus I think if we can get the typewriter effect working then it would be a nice addition for Mike to add in to the plugin for others to use.
davebowker
+2  A: 

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.

Brandon
That's fantastic. Exactly what I wanted. Thankyou. :)
davebowker