Jump to content
GreenSock

Sajidul Islam

Viewport visible to start the animation

Moderator Tag

Recommended Posts

Hi all,

 

I would like to get help with an issue I'm facing. I've made an animation which start scaling after reach at the top of the window. But, I would like to start the scaling when it shows on the viewport. I mean it will scroll slowly and when the section reaches at the top, the animation will be complete.

 

I've searched on the forum and found this can be done with the ScrollToPlugin. As a beginner I'm not sure how I can apply it on my code.

 

Any help would be appreciated.

See the Pen dymRdqW by sajidulislam0 (@sajidulislam0) on CodePen

Link to comment
Share on other sites

Simply adjust your start value: 

// OLD
start: 'top top',  
  
// NEW
start: 'top bottom',  

(meaning to start when the top of the trigger hits the bottom of the viewport)

Link to comment
Share on other sites

Thanks Man, It worked like a char! Really great platform to learn new things.

  • Thanks 1
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.
×