Rokuta Posted February 12, 2022 Share Posted February 12, 2022 Hi, on Codepen demo, I made "text2" fade in after 1sec on page load. It's OK. But it's also waits 1sec when I scroll to element. I want to make elements fade in immediately when user scroll to element, but wait 1sec on page load. Is it possible? thanks See the Pen eYeRxKo by rokuta (@rokuta) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted February 12, 2022 Solution Share Posted February 12, 2022 Sure, just use the isInViewport() method like: delay: ScrollTrigger.isInViewport(element) ? 1 : 0 See the Pen MWOvYjp?editors=0010 by GreenSock (@GreenSock) on CodePen Is that what you meant? 1 Link to comment Share on other sites More sharing options...
Rokuta Posted February 13, 2022 Author Share Posted February 13, 2022 @GreenSock Yes! that is what I meant. I should have read the docs carefully... thank you! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now