Reproducing A Clever Animation Product, Part 4

Today I’m adding two new types of tweens, but once this is done the method for doing subsequent ones should be pretty clear.

The first type is for hiding elements using the display property. This is useful for longer animations where older elements must be hidden so new ones can be seen.

The second type is for changing the scale using the transform property. This is interesting because I’ve chosen a form that takes two parameters rather than just one. Note that the scale function works by applying the operation from the center of the affected element. The element being scaled appears to stay in the same location while all edges of the element move to or away from the center in the same proportion along both the the x- and y-axes. The scaling factor for each axis is specified separately but the x-axis factor changes the right and left edges simultaneously while the y-axis factor changes the top and bottom edges simultaneously. If you want the scaling to appear to be based on another location you’ll have to add offsetting animations to the top and left properties of the element. Finally, if the initial scale for an element is anything other than one, then an extra scale command has to be issued to do so. See the example below for how this can be done.

Here’s an updated animation that uses the three new types of tweens we’ve added.

This entry was posted in Tools and methods and tagged , , . Bookmark the permalink.

Leave a Reply