为什么左移动总是没效果?求指点!(看了大家的提问,试过一些方法,仍旧无效~~)
<!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> #tip{ position:absolute; width:80px; height:80px; background-color:orange; border:1px solid red; margin:10px 100px; color:white; } </style> </head> <body> <input type="button" id="btnLeft" value="左移"/> <input type="button" id="btnRight" value="右移"/> <div id="tip">点击按钮可以移动我哦!</div> <script type="text/javascript"> $(function(){ $("#btnRight").bind("click",function(){ $("div").animate({left:"+=50px"},1000); }); $("#btnLeft").bind("click",function(){ $("div").animate({lef:"-=50px"},1000); }); }) </script> </body> </html>