Colour Animation in Javascript - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:animate

Description

Colour Animation in Javascript

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> 
  <script type="text/javascript" src="jquery.color.js"></script> 
  <script type="text/javascript">
    $(function() {/* w  w  w  .jav a  2  s.c  om*/
        $('#foo').animate({
            backgroundColor: '#fff',
            color: '#000'
        }, 'slow');
    });
    
      </script> 
 </head> 
 <body> 
  <div id="foo" style="background-color: black;">
    Some Text 
  </div>  
 </body>
</html>

Related Tutorials