Jump to content
Search Community

Timeline First Play

Georgi Davitaya test
Moderator Tag

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

Hello,

 

Is it possible not to play the timeline for the first time, when adding animations to it?

 

For example, here's building of timeline:

var tl = new TimelineLite();

tl.to($("#cc_1"), 1, {top:100, ease:Power3.easeOut})
  .to($("#cc_2"), 1, {top:200, ease:Power3.easeOut})
  .to($("#cc_3"), 1, {top:300, ease:Power3.easeOut})
  .to($("#cc_4"), 1, {top:400, ease:Power3.easeOut})
  .to($("#cc_5"), 1, {top:500, ease:Power3.easeOut});

 and call it somewhere in the code, for example onscroll:

$(window).bind("scroll",function(e){
   if ($(window).scrollTop()>100) {
      tl.play();
      ...
   }
}

I want to play animation only after scroll reaches 100, but it is played when the page loads.

 

 

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.
×
×
  • Create New...