自定义动画对背景色的改变是没有效果的吗?

原创2018-11-18 22:17:3362
摘要:<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css">    

<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title>Document</title>
 <style type="text/css">
     div{width: 100px;height: 100px;background-color:blue; position: absolute; margin: 0px ;}
 </style>
 <script type="text/javascript" src="jquery-3.3.1.min.js"></script>
 <script type="text/javascript">
      $(document).ready(function(){
         $('.but').click(function(){
          //document.write("1111");
              $('.but').animate({
                 left:'500px',
                  top:'500px',
                 width:'toggle',
                 background:'pink',
                 opacity:'0.5'
                },2000)
         })
             
      })
        
 </script>
</head>
<body>
    <!--  <button>开始</button> -->
 <div></div>
</body>
</html>

发布手记

热门词条