<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />? <script src="../js/jquery-2.2.3.min.js"></script>? <style type="text/css">? #ani1{? position:absolute;? left:100px;? background-color:red;? }? </style>? <title>動畫練習</title>?</head>?<body>? <input id="btn1" type="button" value="左移"/>? <input id="btn2" type="button" value="右移"/>? <div id="ani1">移動</div></br>? <span></span>? <script type="text/javascript">? $("#btn1").bind("click",function(){? $("#ani1").animate({left:"-=50px"},"slow",$("span").html("執行左移完成"));? });? $("#btn2").bind("click",function(){? ?$("#ani1").animate({left:"+=50px"},"slow",$("span").html("執行右移完成"));? });? </script>?</body></html>看看哪里有問題啊?執行不了動畫
- 1 回答
- 0 關注
- 3794 瀏覽
添加回答
舉報
0/150
提交
取消