哪位高人指點(diǎn)下我的代碼為何移動無效呢?非常感謝
<!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='l' type='button' value='左移'><br>
? ? ? ?<input id='r' type='button' value='右移'>
? ? ? ?<span id='tip'></span>
? ? ? ?<script>
? ? ? ?$(function () {
? ? ? ? ? ? ? ? $("#l").bind('click',function(){
? ? ? ? ? ? ? ? $(this).animate({
? ? ? ? ? ? ? ? ? ? left: "+=100px" ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?},
? ? ? ? ? ? ? ?3000, function () {
? ? ? ? ? ? ? ? ? ?$("#tip").html("執(zhí)行左移完成!");
? ? ? ? ? ? ? ?});
? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? $("#r").bind('click',function(){
? ? ? ? ? ? ? ?$(this).animate({
? ? ? ? ? ? ? ? ? ?right: "+=80px" ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?},
? ? ? ? ? ? ? ?3000, function () {
? ? ? ? ? ? ? ? ? ?$("#tip").html("執(zhí)行右移完成!");
? ? ? ? ? ? ? ?});
? ? ? ? ? ? ? ? });
? ? ? ? ? ? });
? ? ? ? </script>
? ? </body>
</html>
2016-06-23
補(bǔ)充一點(diǎn):你做作業(yè),認(rèn)真看下題目要求好嗎,http://idcbgp.cn/code/1104
出于對回答者的認(rèn)同和尊重,解決了你的問題,請采納,謝謝
2016-06-23
2016-06-22
設(shè)置定位才有效哦