document.getElementById("aa").style.left = document.getElementById("aa").style.left + 1;这句话有语法错误吗?

解决方案 »

  1.   

    但是你看这个例子就知道了<!--左边的广告 开始-->
    <DIV id=ad_dl01 style="Z-INDEX: 1; LEFT: 5px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 95px">
    <TABLE cellSpacing=0 cellPadding=0 width=100 border=0>
      <TBODY>
      <TR>
        <TD align=left><A onclick="ad_dl01.style.visibility='hidden'"><IMG 
          height=16 src="第二书店--中国最专业计算机图书网上专营店.files/yanglan_01.gif" width=100 
          border=0></A></TD></TR>
      <TR>
        <TD><A href="http://www.dearbook.com.cn/2006/daigou.htm" 
          target=_blank><IMG height=184 
          src="第二书店--中国最专业计算机图书网上专营店.files/duilian2.gif" width=100 
      border=0></A></TD></TR></TBODY></TABLE></DIV>
    <!--左边的广告 结束--><!--左右广告的移动操作开始-->
    <SCRIPT type=text/javascript>
    var step_ratio = 0.1;
    objs = new Array();
    objs_x = new Array();
    objs_y = new Array();//name表示广告条,x,y代表在画面中广告条移动的目的位置
    function addfollow(name, x, y) {
      i = objs.length;
      objs[i] = document.getElementById(name);
      objs_x[i] = x;
      objs_y[i] = y;
    }function follow() {
      for(var i=0; i<objs.length; i++) {
        var fm = objs[i];
        var fm_x = objs_x[i];
        var fm_y = objs_y[i];    if (fm.offsetLeft != document.body.scrollLeft + fm_x) {
          var dx = (document.body.scrollLeft + fm_x - fm.offsetLeft) * step_ratio;
          dx = (dx > 0 ? 1 : -1) * Math.ceil(Math.abs(dx));
          fm.style.left = fm.offsetLeft + dx;
        }    if (fm.offsetTop != document.body.scrollTop + fm_y) {
          var dy = (document.body.scrollTop + fm_y - fm.offsetTop) * step_ratio;
          dy = (dy > 0 ? 1 : -1) * Math.ceil(Math.abs(dy));
          fm.style.top = fm.offsetTop + dy;
        }
        fm.style.display = '';
      }
    }addfollow("ad_dl01", 5, 180);
    setInterval('follow()',20);
      

  2.   

    <DIV id=ad_dl01 style="Z-INDEX: 1; LEFT: 5px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 95px">
    POSITION: absolute  注意这个,他是有这个才能动的
      

  3.   

    <html>
    <head>
    </head><body><div id="aa">
    <table>
    <tr>
    <td>jintian</td><td>明天</td>
    </tr>
    </table>
    </div>
    <div id="ab">鸟1</div><script>
    function dde()
    {
    alert(document.getElementById("aa").style.left);
    document.getElementById("aa").style.left=document.getElementById("aa").style.left+100;
    }
    </script><A onclick="dde(); return false;">移动</A></body>
    </html>
    ======
    <div id="aa" style="position:absolute">//关键
      

  4.   

    <html>
    <head>
    <LINK rel="NEXT" href="http://www.sina.com">
    </head>
    <body>
    <DIV id=ab style="Z-INDEX: 1; RIGHT: 5px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 95px;">
    <TABLE cellSpacing=0 cellPadding=0 width=100 border=0>
      <TBODY>
      <TR>
        <TD align=right><A onclick="ab.style.visibility='hidden'"><IMG 
          height=16 src="http://image2.sina.com.cn/sms/sinapic/27120507-index.jpg" width=100 
          border=0></A></TD></TR>
      <TR>
        <TD><A href="http://www.dearbook.com.cn/pile/default.aspx" 
          target=_blank><IMG height=184 
          src="http://image2.sina.com.cn/ty/up/2006-05-27/U339P6T64D20401F1091DT20060527113609.jpg" width=100 
      border=0></A></TD></TR></TBODY></TABLE></DIV><script>
    var i=0;
    function dde()
    {
    i=i+100;
    getElementById("ab").style.top = i;
    }
    </script><A onclick="dde(); return false; ">移动</A></body>
    </html>这个也不好使啊,怎么改?