Skip to content
maxkfranz edited this page Apr 24, 2012 · 4 revisions

eles.delay()

Add a delay in between one animation and another for all elements in the collection.

eles.delay( time, [ function(now) ] )

Adds a delay before future animations

time : The duration of the delay in milliseconds
function(now) : A callback function called after the delay is done where now is the current time

Details

This function is equivalent to running an animation that does nothing for the specified amount of time. Like a regular animation, it will run immediately if the animation queue is empty. Otherwise, it will be put at the end of the animation queue.

Examples

Animate to red then blue with a delay in between:

cy.nodes()
  .animate({ bypass: { fillColor: "red" } })
  .delay( 1000 )
  .animate({ bypass: { fillColor: "blue" } });

Clone this wiki locally