pietM Posted February 10, 2023 Share Posted February 10, 2023 Hi everyone! Not sure why the enclosed timeline doesn't reverse on click when I can revers w/ ScrollTrigger and "mouseleave" events? As always, any feedback is greatly appreciated. "Closer" / ".closer" class should do it. See the Pen WNKVvgm by evryali (@evryali) on CodePen Link to comment Share on other sites More sharing options...
akapowl Posted February 10, 2023 Share Posted February 10, 2023 Hello Piet. That is because you have a click event listener on the parent, that tells the timeline to play - you can check in your example by putting a console.log on that parent's eventListener, and you will see, that the parents' function will be called, too, when you click your .closer: See the Pen gOjVaPZ by akapowl (@akapowl) on CodePen So basically you are giving contradicting instructions on clicking your .closer. The best would be to just put the eventListener to play your timeline on a different element (like maybe the header). 3 Link to comment Share on other sites More sharing options...
pietM Posted February 10, 2023 Author Share Posted February 10, 2023 Thank you! Your prompt response, as always, helped to fix the issue. Working pen enclosed. Thanks again! 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