Jump to content
Search Community

tweenmax scroller

kempo test
Moderator Tag

Go to solution Solved by PointC,

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

I'm working on a banner using TweenMax, I want to scroll 5 divs form right to left and display 3 at a time (except right at the beginning and right at the end). It is hard to explain without looking at the result. You will see that only 2 divs are currently displayed at once.

See the Pen XdyybQ by jakepeg (@jakepeg) on CodePen

Link to comment
Share on other sites

  • Solution

Hi kempo  :)

 

I'm not sure I completely understand your question, but my guess is that you need three stopping points in the animation so three divs can be shown at once. (except, as you said, at the beginning and end). The current problem is that you're using only one stopping point, pausing for 0.1 seconds and then animating the div off screen. My solution for you would be to use the aforementioned three stop positions and then stagger the divs. The code I used:

var tl = new TimelineMax(),
    time = 0.9, //animation time to move between positions
    thePause = 0.2; // time to wait before the next move

tl.staggerTo(".number", time, {left:200,top:50},time+thePause)
  .staggerTo(".number", time, {left:100, top:0}, time+thePause, time+thePause)
  .staggerTo(".number", time, {left:0, top:50}, time+thePause, (time+thePause)*2)  
  .staggerTo(".number", time, {left:-100, top:100}, time+thePause, (time+thePause)*3); 

Here's the CodePen:

See the Pen RaqOGJ by PointC (@PointC) on CodePen

 

Hopefully that helps a bit.

 

Happy tweening.

:)

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