Jump to content
GreenSock

Tween

.iteration()

.iteration( ) : *

Gets or sets the iteration (the current repeat) of tweens.

Returns : *

Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining.

Details

Gets or sets the iteration (the current repeat) of tweens. For example, if repeat is 4, and the playhead is currently on its third repeat, .iteration() will return 3.

Including a number will cause the tween to jump to iteration number given. For example, if the repeat is 4, and the playhead is currently on its third repeat, .iteration(2) will make the tween jump back to the second iteration.

  1. var progress = myTween.iteration(); //gets current iteration
  2. myTween.iteration( 2 ); //sets iteration the second iteration
Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.
×