用jQuery的animate()写的动画效果,执行不了呢?

<!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>

看看哪里有问题啊?执行不了动画

瓶水相逢
浏览 3748回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JQuery