Jump to content
Search Community

ScrollReveal clone with gsap.

Jens De Muynck test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

I'm trying to create a ScrollRevealJS clone with the help of gsap. The method gsap.from() seems perfect for this. The only problem i have, is that i want my elements to have a default opacity of 0, and animate to an opacity of 1, but i'm not sure what the cleanest way to go about this is. I know i can just 'gsap.to(element, { opacity: 1 })' right after 'gsap.from(element, correspondingElementObject.properties);',  and set the default opacity to 0.

The problem with that is that i use gsap for other stuff outside of my ScrollReveal class, so when i set a default delay and duration, I dont want the rest of the website to be affected by the settings.

 

Thanks in advance!

See the Pen ExRrabY by JensDeMuynck (@JensDeMuynck) on CodePen

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