Jump to content
Search Community

Multiple timeline play issue.

Zaar test
Moderator Tag

Go to solution Solved by Carl,

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

Hi,

 

I have three boxes and three buttons. everytime the user click on the button , the corresponding box and it's content need to animate in and other boxes and its animations need to reverse. I created the following code but some how it is not working. Please help me.

 

$(document).ready(function() {
  $('body').fadeIn(2000);
  mainTl = new TimelineMax({ paused: true });
  $('.box').each(function(index, element){
   var labelNew = 'box' + index;
  var tl_box1 = new TimelineMax();  
  tl_box1.set('.box', {top: '42%',left:'10%'})  
  .from('.box',0.2, {scale:0.5, autoAlpha:0, top:'-100px',  ease: Bounce.easeIn, force3D:true},2);
    mainTl.add(tl_box1,labelNew);
    mainTl.addPause(labelNew);
    
   });
 
  mainTl.pause();
  $('body').on('click', '#circle-block1', function(event) {
mainTI.reverse();
mainTI.tweenTo("box0");
 
 
});

 

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...