jquery animate({background:'red'})無效果???
<!DOCTYPE html>
<head>
? ? <meta charset="utf-8">
? ? <script type="text/javascript" src="../js/jquery-2.0.0.min.js"></script>
? ? <script type="text/javascript">
? ? ? ? $(document).ready(function()
? ? ? ? {
? ? ? ? ? ? $(".btn1").click(function (){
? ? ? ? ? ? ? ? $("p:eq(0)").animate({
? ? ? ? ? ? ? ? ? ? height : '300px',
? ? ? ? ? ? ? ? ? ?background : 'red'});
? ? ? ? ? ? });
? ? ? ? ? ? $(".btn2").click(function () {
? ? ? ? ? ? ? ? $("p:eq(0)").animate({
? ? ? ? ? ? ? ? ? ? height : '100px'
? ? ? ? ? ? ? ? })
? ? ? ? ? ? })
? ? ? ? })
? ? </script>
</head>
<body>
<p style="background:#00B83F">This is a paragraph.</p>
<button class="btn1">Hide</button>
<button class="btn2">Show</button>
</body>
</html>
2018-04-08
動畫只能用于數(shù)值的效果 比如高寬 爾不能用于背景顏色的效果
2019-04-05
不看文檔嗎。。。。
2018-05-22
$aaron.animate({
?????????????? ?
??????????? },100, function(){
??????????????? $(this).css("background-color","red")
??????????? });
可以換種方法改變背景顏色