The Anim Utility provides the ability to animate changes to style properties. Advanced easing equations are provided for more interesting animated effects.
NOTE: Depending on which features are required, you may want to consider using the Transition Utility as an alternative to Anim. The Transition Utility isn't as feature rich as Anim, but it leverages native CSS Transitions when possible, provides a smaller payload, and can be hardware-accelerated.
Your Animation implementation will consist of one or more instances of the Anim.
To create an Anim instance on your page, pass it a configuration object including the node or selector query for the node that you wish to animate and a to containing the properties you wish to animate.
To begin the actual animation, call the run method on your Anim instance.
See the API documentation for the Anim object for more information about its methods and properties.
In addition to passing a configuration object to the Anim constructor, you can access the attributes of your Anim instance via the set and get methods.
A node attribute and a to attribute containing one or more properties to animate are the minimum requirements for running an animation.
The value of a to can optionally be a function. If a function is used, it receives the node as its only argument. The return value of the function becomes the to value for that run of the animation.
Use the optional from attribute to start the animation from a specific value. When from is omitted, the current value is used.
Like the to attribute, the value of a from property can optionally be a function. If a function is used, it receives the node as its only argument. The return value of the function becomes the from value for that run of the animation.
The Animation Utility defines events useful for hooking into the various stages of an animation. The on method is used to attach event listeners.