7-13编程练习左右移问题
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery动画特效</title> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script> <style type="text/css"> div{ width:80px; height:80px; background-color:green; margin-top:30px; position:absolute; color:white; } </style> </head> <body> <input id="left" type="button" value="左移" /> <input id="right" type="button" value="右移" /> <div></div> <script type="text/javascript"> $(function(){ $("#left").bind("click",function(){ $("div").animate({right:"+=50px"},3000,function(){ $("div").html("左移完成"); }); }); $("#right").bind("click",function(){ $("div").animate({left:"+=50px"},3000,function(){ $("div").html("右移完成"); }); }); }); </script> </body> </html>
为什么一点击完右移之后,再点击左移,左移就执行不了呢?