kmytor Posted April 28, 2020 Share Posted April 28, 2020 I would like that by clicking alternate or quick clicks the animation of this event on the timeline will not be damaged, What I mean is if I quickly click on the buttons to change the image galleries do not get damaged Is there any way to tell it when show animation ends show hide animation? I am not very expert and I am in daily learning Thank you! See the Pen XWmgyeo by kmytor (@kmytor) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted April 28, 2020 Share Posted April 28, 2020 Hey kmytor. The best thing to do in this situation is to setup a timeline outside of your event listener functions and then use control methods to control that timeline inside of the event listener functions. Here's how I'd set it up: See the Pen VwvWqZK?editors=0010 by GreenSock (@GreenSock) on CodePen For more about this and a bunch of other helpful tips, I highly recommend my article on animating efficiently. Let me know if you have any questions! 2 1 Link to comment Share on other sites More sharing options...
kmytor Posted April 28, 2020 Author Share Posted April 28, 2020 Great, you summarized all my mess in a few lines Thank you If I would like to know why you used constant Link to comment Share on other sites More sharing options...
OSUblake Posted April 28, 2020 Share Posted April 28, 2020 2 minutes ago, kmytor said: If I would like to know why you used constant? const name = xxxxxxxx; ? Why did you use let? const is just a pattern some people use for variables that won't be reassigned. 2 Link to comment Share on other sites More sharing options...
OSUblake Posted April 28, 2020 Share Posted April 28, 2020 And const isn't a constant in the way some people think. const obj = { value: 0 }; console.log(obj.value) // 0 obj.value = 33; console.log(obj.value) // 33 4 1 Link to comment Share on other sites More sharing options...
PointC Posted April 28, 2020 Share Posted April 28, 2020 20 minutes ago, OSUblake said: And const isn't a constant in the way some people think. 2 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