2010-09-04 101 views

回答

0

這可以很容易地與jQuery color plugin實現:

<!DOCTYPE html> 
<html> 
<head> 
    <title>Test</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <script type="text/javascript" src="http://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() { 
     $('#foo').animate({ 
      backgroundColor: '#fff', 
      color: '#000' 
     }, 'slow'); 
    }); 
    </script> 

</head> 
<body> 
    <div id="foo" style="background-color: black;">Some Text</div> 
</body> 
</html> 

看到它在action here

+0

我可以使用設置的超時嗎? – Sam 2010-09-04 09:04:12

+0

當然,你可以:http://jsfiddle.net/4p5ZG/1/ – 2010-09-04 09:08:16

+0

是否有可能使用ur方法,如果div在另一個函數中創建一些文本說段落和身體只是 ??? – Sam 2010-09-04 11:34:16