jQuery animate多重动画

head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style>
      #pale1 {
            width:150px;
            height:150px;
            position:relative;
            background-color:aqua;
        }
      #pale2 {
            width:150px;
            height:150px;
            position:relative;
            background-color:red;
        }

    </style>
	<meta charset="utf-8" />
    <script src="../Scripts/jquery-1.11.3.js"></script>
    <script>
        $(function () {
            $("#pale1").click(function () {
                //先向右并变高
                $(this).animate({ left: "500px", height: "300px" }, 3000)
            });
       
         $(function () {
            $("#pale2").click(function () {
               //先向右再变高
                $(this).animate({ left: "500px" }, 3000).animate({ height: "300px" }, 3000);
            });         });   </script> </head> <body> <div id="pale1"></div>   <div id="pale2"></div> </body>


猜你喜欢

转载自blog.csdn.net/mogul1/article/details/80963104
今日推荐