Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 24th, 2012  |  syntax: None  |  size: 0.38 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. can a .classA styles to .classB styles be animated easly?
  2. .classA{
  3.    color:red;
  4. }
  5. .classB{
  6.    color:blue;
  7. }
  8.  
  9. function animate(selector,classA,classB,time){
  10.     styles1 = $(classA).invented_get_styles();
  11.     styles2 = $(classB).invented_get_styles();
  12.     $(selector).animate(styles1,styles2,time);
  13. }
  14.        
  15. $( ".element_to_be_animated" ).switchClass( "oldClass", "newClass", 1000 );