Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
dmchaledesigner

loop through a complete animation - help

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

just recently started using GSAP and tinkering around with it for a html5 banner.

From using the forums here ive just messed around with adding in two simple sequences using functions as suggested by the good people here. just wondering how i repeat the entire timeline from the merged function ie, repeat 2 times and pause

 

code here: https://github.com/dmchaledesigner/greensock_html5_banner

 

Link to comment
Share on other sites

Hi dmchaledesigner,

 

Welcome to the forums! 

 

If you are using TimelineMax:

var tl = new TimelineMax({repeat:2});

That simple.

 

If you are using TimelineLite:

var plays = 0;
var tl = new TimelineLite({onComplete:loop})

function loop() {
 if(plays <= 2) {
  tl.play(0);
  plays++;
 }
}
  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×