Created
May 17, 2016 08:13
-
-
Save floscr/eff53d841920e3effc78547c73eb3861 to your computer and use it in GitHub Desktop.
GSAP End Loop after X runs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tl = new TimelineMax() | |
.from(myObj, 1, { /* ...values... */ }, 0) // Will play in every loop | |
.call(loopCheck) // End loop after X times | |
.from(myObj, 1, { /* ...values... */ }, 0) // Will not play on the last loop | |
.repeat(-1) | |
var loop = 0; | |
var loopMax = 3; | |
function loopCheck() { | |
loop++; | |
if (loop === loopMax) { | |
tl.pause(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment