为什么不会动?
为什么不会动? =。=
2015-04-24
代码有错误
jquery没用引用
<!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> </head> <body> <input id="left" type="button" value="左移"> <input id="right" type="button" value="右移"> <div style="width:200px;background-color: red">Hello world!</div> </body> <script type="text/javascript"> $(function(){ $("#left").bind("click",function(){ $("div").animate({ width:"-=50px" }, 3000, function(){ $("#left").html("Done!"); } ); }); $("#right").bind("click",function(){ $("div").animate({ width:"+=50px" }, 3000, function(){ $("#right").html("Done!"); } ); }); }); </script> </html>
举报