Jump to content
Search Community

Scale element up and then down to less than 100% - is there a simpler solution

Antdev test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

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

  • Solution

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

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...