解决方案 »

  1.   

    有没有对IE滚动条直接编程的javascript代码?
      

  2.   

    刚写的,根据坐标来实下,IE6下可以用
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>AutoScroll</title>
    </head>
    <script type="text/javascript">
    //箭头大小
    var wid = 14, hei = 14;
    var dir = "";
    var scrollSize = 10; //每次移动多少个像素
    var interval = 200;  //移动间隔,毫秒
    document.onmousemove = function(){
    var width = document.documentElement.clientWidth;
    var height = document.documentElement.clientHeight;
    var x = event.clientX;
    var y = event.clientY;
    //document.title = width + "-" + x + "----" + height + "-" + y;
    if(x > width && x < width + wid){
    //向上
    if(y > 0 && y < hei){
    dir = "up";
    }else if(y > height - hei && y < height){ //向下
    dir = "down";
    }else{
    dir = "";
    }
    }else{
    dir = "";
    }
    //滚动
    if(dir != ""){
    startScroll();
    }
    }
    function startScroll(){
    if(dir == "up"){
    document.documentElement.scrollTop -= scrollSize;
    }else if(dir == "down"){
    document.documentElement.scrollTop += scrollSize;
    }
    if(dir != ""){
    setTimeout("startScroll()", interval);
    }
    }
    </script>
    <body>
    <table width="1200" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="100">&nbsp;</td>
      </tr>
      <tr>
        <td>
            <table width="700" border="0" align="center" cellpadding="6" cellspacing="0" class="tb">
              <tr class="tr">
                <td align="center">AutoScroll</td>
              </tr>
              <tr>
                <td align="center">
                 </td>
              </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td height="1200">&nbsp;</td>
      </tr>
    </table> 
    </body>
    </html>