? ? ? ? <style>? ? ? ? ? ? #wu{? ? ? ? ? ? ? ? position:absolute;? ? ? ? ? ? ? ? height: 20px;? ? ? ? ? ? ? ? width: 20px;? ? ? ? ? ? ? ? background-color: red;? ? ? ? ? ? }? ? ? ? ? ??? ? ? ? </style>? ? </head>? ??? ? <body>? ? ? ? <input id="you" id="zuo" type="button" value="左移"></input>? ? ? ? <input type="button" value="右移"></input>? ? ? ? <div id="wu"></div>? ? ? ? <div id="liu"></div>? ? ? ??? ? ? ? <script text="text/javascript">? ? ? ? ? ?$("#zuo").bind("click",function(){? ? ? ? ? ? ? ?$("div").animate({? ? ? ? ? ? ? ? ? ?left: "+=50px"},2000,function(){? ? ? ? ? ? ? ? ? ? ? ?$("liu").html("請(qǐng)點(diǎn)擊另一個(gè)按鈕!");? ? ? ? ? ? ? ? ? ?}? ? ? ? ? ? )};? ? ? ? ? ??? ? ? ? ? ? $("#you").bind("click",function(){? ? ? ? ? ? ? ?$("div").animate({? ? ? ? ? ? ? ? ? ?left: "+=50px"},3000,function(){? ? ? ? ? ? ? ? ? ? ? ?$("liu").html("執(zhí)行完畢!");? ? ? ? ? ? ? ? ? ?}? ? ? ? ? ? )};? ? ? ? </script>? ? </body>
1 回答
已采納

李曉健
TA貢獻(xiàn)1036條經(jīng)驗(yàn) 獲得超461個(gè)贊
$("#zuo").bind("click",?function?()?{ ????$("div").animate({ ????????????????left:?"+=50px" ????????????},?2000,?function?()?{ ????????????????$("liu").html("請(qǐng)點(diǎn)擊另一個(gè)按鈕!"); ????????????} ????) });?//這里少了一個(gè)括號(hào) $("#you").bind("click",?function?()?{ ????$("div").animate({ ????????????????left:?"+=50px" ????????????},?3000,?function?()?{ ????????????????$("liu").html("執(zhí)行完畢!"); ????????????} ????) });//這里少了一個(gè)括號(hào)
input 標(biāo)簽不需要寫 </input> 結(jié)束標(biāo)簽
- 1 回答
- 0 關(guān)注
- 1258 瀏覽
添加回答
舉報(bào)
0/150
提交
取消