Packagecom.greensock.plugins
Classpublic class CSSPlugin
InheritanceCSSPlugin Inheritance TweenPlugin Inheritance Object

With the help of the CSSPlugin, GSAP can animate almost any css-related property of DOM elements including the obvious things like width, height, margins, padding, top, left, and more plus more interesting things like transforms (rotation, scaleX, scaleY, skewX, skewY, x, y, rotationX, and rotationY), colors, opacity, and lots more. Load the CSSPlugin js file to enable these capabilities and then make sure you define your values (in camel case form) inside a "css" property of the vars parameter, like this:
//notice the css-related values are inside the "css" object but the ease is not:
TweenLite.to(element, 1, {css:{top:"20px", left:"100px", backgroundColor:"#FF0000"}, ease:Power2.easeOut});

Note: a common mistake is to forget to wrap css-related properties in a css object which is essential for specifying your intent. Remember, GSAP (GreenSock Animation Platform) isn't just for tweening css properties. And always use camel case representations of the properties, so instead of "font-size", you'd use "fontSize".

To get up and running quickly with GSAP, check out the Jump Start tour which covers the basics in a fun, interactive way. To see the CSS3-specific features (like 3D transforms, boxShadow, textShadow, borderRadius, and clip) demonstrated and explained, see http://www.greensock.com/css3/.

You can even define properties that are not generally tweenable and GSAP will apply the property for you (like position:"absolute" or borderStyle:"solid"). These non-tweenable properties will be set at the beginning of the tween (except display:"none" which will be applied at the end of the tween for obvious reasons).

It is typically a good idea to define a unit of measurement (like "24px" instead of "24" or "50%" rather than "50") but the default in most cases is pixels (px), so you can omit the unit if you prefer. In fact, you can define your own defaults using the CSSPlugin.suffixMap object. And even if the unit of measurement doesn't match the current one, GSAP will attempt to convert them for you. So, for example, you could tween a width from "50%" to "200px".

CSSPlugin can even animate complex values like boxShadow:"0px 0px 20px 20px red" and borderRadius:"50% 50%" and border:"5px solid rgb(0,255,0)" . When necessary, it attempts to figure out if the property needs a vendor prefix and applies it accordingly. There may be a small subset of complex or bleeding-edge css properties that CSSPlugin can't handle yet, but the vast majority work great.

In addition to almost all of the standard css properties, CSSPlugin recognizes some special ones that can be quite convenient:

Copyright 2008-2012, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for Club GreenSock members, the software agreement that was issued with the membership.