幫我看看那里錯(cuò)了,怎么么有效果啊
<!DOCTYPE html>
<html>
? ? <head>
? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
? ? ? ? <title>jQuery動(dòng)畫特效</title>
? ? ? ? <style>
? ? ? ? ? ? div{width:100px;
? ? ? ? ? ? ? ? height:100px;
? ? ? ? ? ? ? ? background:red;
? ? ? ? ? ? ? ? position:absolute;
? ? ? ? ? ? ? ? }
? ? ? ? </style>
? ? ? ? <script>
? ? ? ? ? ? $(function(){
? ? ? ? ? ? ? ? $("#btn1").bind("click",function(){
? ? ? ? ? ? ? ? ? ? $("div").animate({left:"+=50px"},300)
? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? $("#btn2").bind("click",function(){
? ? ? ? ? ? ? ? ? ? $("div").animate({left:"-=50px"},300)
? ? ? ? ? ? ? ? });
? ? ? ? ? ? })
? ? ? ? </script>
? ? </head>
? ??
? ? <body>
? ? <input id="btn1" type="button" value="向左"/>
? ? <input id="btn2" type="button" value="向右"/>
? ? <div></div>
? ? ? ??
? ? </body>
</html>
2016-03-25
沒有調(diào)用jQuery庫(kù),<head></head>里加: