Jump to content
GreenSock

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

Using multiple tweens within a Superscrollorama object?

Recommended Posts

Is it possible to use a Superscrollorama object to control multiple timelines?

 

My code:

See the Pen AwIbx by vincentccw (@vincentccw) on CodePen

 

RIght now the box1 class is animating as intended, but I'm only allowed to animate one box at a time, if I add another timeline below it, the whole animation stop working.

 

Is there a better way to add multiple animation timelines or do I need to create multiple scrollorama object to hold individual timeline>

Link to comment
Share on other sites

Maybe someone here is familiar enough with it to assist you, but this is not the superscrollorama support forum so your question might be better suited at their GitHub.

 

That said, are you sure you're using the right syntax to add multiple timelines? I have zero idea how superscrollorama works, but it seemed like the syntax would be more like this, and it seems to be working?

controller.addTween(
  0,
  mainTweenSlideDown.fromTo($('.box1'), 1, {css:{top: 0}, immediateRender:true}, {css:{left: 500}})
  		    .to($('.box1'), 1, {css:{left: 300},onComplete: function(){console.log('test')}}),
  500
);
  
controller.addTween(
  0,
  mainTweenSlideDown2.fromTo($('.box2'), 1, {css:{top: 0}, immediateRender:true}, {css:{left: 500}})
  		     .to($('.box2'), 1, {css:{left: 300},onComplete: function(){console.log('test')}}),
  500 
);

You should also remove display:table-cell from the boxes - not every browser allows you to position table cells.

  • Like 1
Link to comment
Share on other sites

Thanks for the help, yes I will redirect the question to their official GitHub page  :-P

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