Antdev Posted April 22, 2022 Share Posted April 22, 2022 Stupid question probably but just curious if there is a better way (one line perhaps) to scale an element up then scale back down again to less than 100%. My timeline code works but as I am new I just wanted to check there wasn't a better way to write the code for this. Thanks Ant See the Pen RwxOKXZ by antdev (@antdev) on CodePen Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted April 22, 2022 Solution Share Posted April 22, 2022 I wouldn't worry about there being a better way, unless your are animating hundreds of elements. You can always go in later to optimize certain things. What you could do is add de duration to the `defaults:{}` object of the time line and you can put it all on one line, but that makes it less readable, so that is not really a plus. See the Pen XWVQMGM?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen 2 Link to comment Share on other sites More sharing options...
Antdev Posted April 22, 2022 Author Share Posted April 22, 2022 Thank you mvaneijgen - just wanted to check there wasn't some sort of yoyo behaviour to do this or something along those lines. My code is working fine so happy to move on. 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