Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
ehow

Using a predefined css rule as an animation parameter

Recommended Posts

Hi all,

 

I'd like to know if its possible to use TweenMax/Lite with a predefined CSS rule, something like this:

 

.someClass

{

     left: 20px;

     top: 50px;

}

 

TweenLite.to( myDomElement, 0.5, { someClass });

 

In this way I could lay out a bunch of scenarios and animate to them as needed.

 

Thanks!

Link to comment
Share on other sites

Hi! Welcome to the GreenSock forums.

 

You can tween a classname

 

 

.sample{
background-color:#f00;
width:200px;
}

TweenLite.to(myElement, 1,{className:"sample"});

 

 

Please see the getting started guide and the CSSPlugin docs for more info.
http://www.greensock.com/get-started-js/
http://api.greensock.com/js/com/greensock/plugins/CSSPlugin.html

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.
×