Али К Posted January 23, 2021 Share Posted January 23, 2021 lt.call(function () { $('.c1').addClass('opacityOpen2') $('.c2').addClass('opacityOpen3') $('.c3').addClass('opacityOpen4') }) even if used .add() i will get the same result See the Pen gOwJyxr by itsalimanuel (@itsalimanuel) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted January 23, 2021 Share Posted January 23, 2021 Hey Ali. What do you mean "remove my function after I go out of the section in scroll"? Is this timeline attached to a ScrollTrigger? Do you mean that you want this function to fire the first time the section is entered by not any other time? A minimal demo would greatly help us help you. Link to comment Share on other sites More sharing options...
Али К Posted January 24, 2021 Author Share Posted January 24, 2021 @ZachSaucier To post the code don't make any change , I mean , if I go out the section, the function will be off , and when I come back to the same section the function will be on again (it's like play on hover) Link to comment Share on other sites More sharing options...
GreenSock Posted January 24, 2021 Share Posted January 24, 2021 Like Zach, I'm a bit confused by your question. Are you saying that you want to CALL a specific function whenever you enter a section on scroll? Functions aren't "on" or "off" - they're just objects that can be invoked. If you want to call a specific function like that, sure, just use the onEnter and onEnterBack callbacks in a ScrollTrigger. It's all in the docs. 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