Jump to content
Search Community

Recommended Posts

Posted

Hi, 

 

I have a problem on this animation. When a user scroll for the first time the first div scale to 0 and set its height to 0 then it displays none.

That's works well on first div animation but with the second div it don't work as it should do with the first.

What i am doing wrong and how i can solve that issue?

See the Pen qBMPdYx by Andy199807 (@Andy199807) on CodePen.

Posted

Hey, so the markers are in the wrong place as you're adjusting the height of the body.

You can call ScrollTrigger.refresh() to get around this - this works but is this really what you're going for? It seems a little odd.

See the Pen gOdGpyN?editors=0010 by GreenSock (@GreenSock) on CodePen.

 

You can't scroll back up and the animation happens immediately after the first ends.

Posted

Why the second div animate automatically once finished the first div animation?

Posted

Because the start trigger point is 'top top' - That means 'when the top of this element hits the top of the viewport.'
 

Posted

I am confused dunno how to fix that issue. Do you?

Posted

I don't know what you're trying to achieve! The code is currently doing what you're telling it to. What do you want to happen?

Posted

the first scroll does what i want and i would like it does the same with the  second div on scrolling into it. 

Not that it does it automatically, but once is scrolling.  

Posted

Sure! Well you could move the start position further down so that you have to scroll in order to hit it. i.e.

start: "10% top"
 

  • Like 1
Posted

Ok now i understood @Cassie,but if i reload the page the first and the second div are not visibile. I would like have those restart from the beginning once reload the page, how i do that?

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