如果改变上滑和下滑的速度 下面是我的代码 感觉有些慢<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $(".btn1").click(function(){
  $("img").animate({top:"100px"});
  });
  $(".btn2").click(function(){
  $("img").animate({top:"0px"});
  });
});
</script>
</head>
<body>
<button class="btn1">Animate</button>
<button class="btn2">Reset</button>
<div style="position:relative">
<img src="1.png" style="position:absolute"/>
</div>
</body>
</html>

解决方案 »

  1.   

    $("#box").animate({height:300},"slow");
    这个东西的第二个参数是设置速度的,查下看speed可选。规定动画的速度。默认是 "normal"。
    可能的值:
    毫秒 (比如 1500) 
    "slow" 
    "normal" 
    "fast" 
      

  2.   

    我修改为这样了 还是没修改速度一样
      $("img").animate({top:"0px"},"10000");});
      

  3.   

    数字的话,不要引号,
    $("img").animate({top:"0px"},10000);});直接就这样写就好了,只是你这个速度估计看不出来吧太慢了