Tweens any numeric attribute of a DOM element. For example, let's say your DOM element looks like this:
<rect id="rect" fill="none" x="0" y="0" width="500" height="400"></rect>
You could tween the "x", "y", "width", or "height" attributes using AttrPlugin like this:
TweenLite.to("#rect", 1, {attr:{x:100, y:50, width:100, height:100}, ease:Linear.easeNone});
You can tween an unlimited number of attributes simultaneously. Just use the associated property name inside the attr:{}
object. AttrPlugin is NOT intended to be used with css-related properties because the CSSPlugin already handles those. Note: a common mistake is to forget to wrap attributes in a attr:{}
object which is essential for specifying your intent.
- 1
Recommended Comments
There are no comments to display.
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