http://www.csdn.net/expert/topic/848/848715.xml?temp=.4786493横向滚动没有,自己加上吧。

解决方案 »

  1.   

    这是我珍藏的一段代码:<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title></title><style type="text/css">.button {
    background: ButtonFace;
    border: 1px solid ButtonShadow;
    border-left: 0;
    border-right: 0;
    }.scrollButton {
    font-family: Webdings;
    color: blue;
    text-align: center;
    cursor: hand;
    }#scrollContainer {
    height: 100%;
    overflow: hidden;
    padding: 0px;
    }.border {
    border-left: 1px solid ButtonShadow;
    border-right: 1px solid ButtonShadow;
    width: 200px;
    }
    </style>
    </head>
    <script language="javascript">
    /*
    功能:滚动*/
    function ScrollButton( oEl, oScrollContainer, nDir ) {
    this.htmlElement = oEl;
    this.scrollContainer = oScrollContainer;
    this.dir = nDir;

    var oThis = this;
    oEl.onmouseover=function(){oThis.startScroll()} //捕作事件
    oEl.onmouseout=function(){oThis.endScroll()}}ScrollButton.scrollIntervalPause = 100;
    ScrollButton.scrollAmount = 18;ScrollButton.prototype.startScroll = function () {
    var oThis = this;
    this._interval = window.setInterval( function () {
    switch ( oThis.dir ) {

    case 8:
    oThis.scrollContainer.scrollTop -= ScrollButton.scrollAmount;
    break;

    case 2:
    oThis.scrollContainer.scrollTop += ScrollButton.scrollAmount;
    break;

    case 4:
    oThis.scrollContainer.scrollLeft -= ScrollButton.scrollAmount;
    break;

    case 6:
    oThis.scrollContainer.scrollLeft += ScrollButton.scrollAmount;
    break;
    }
    }, ScrollButton.scrollIntervalPause );
    };ScrollButton.prototype.endScroll = function () {
    if ( this._interval != null ) {
    window.clearInterval( this._interval ); //结束滚动
    this._interval=null;
    }
    };</script><body id="bdy" topmargin="0" leftmargin="0" scroll="no" onselectstart="javascript:return false" ondragstart="javascript:return false" oncontextmenu="javascript:return false">
    <center>
    <table align="center" width="100%" height="100%" border=0><tr><td align="center" rowspan=2><div id="scrollContainer">
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
    在这个层里添加你的内容!其他的地方不动!<br><br><Br>
      </div>  </td>
      <td  width=16 valign="top">
    <div class="scrollButton" id="upScrollButton">5</div>
      </td>
      
      </tr>
      <tr><td  width=16 valign="bottom">
    <div class="scrollButton" id="downScrollButton">6</div>
      </td></tr>
     </table><script type="text/javascript">ScrollButton.scrollIntervalPause = 50; //
    ScrollButton.scrollAmount = 5;var upScrollButton = document.getElementById( "upScrollButton" );
    var downScrollButton = document.getElementById( "downScrollButton" );
    var scrollContainer = document.getElementById( "scrollContainer" );
    //var bodyObj=document.getElementById( "body" );new ScrollButton( upScrollButton, scrollContainer, 8 );
    new ScrollButton( downScrollButton, scrollContainer, 2 );</script>
    </body>
    </html>
      

  2.   

    不记得是从哪儿得到的,完全解决你的问题.<style type="text/css">
    <!--
      .opacity {FILTER: alpha(opacity=100)}
    -->
    </style>
    <script>
      function movstar(a,time){
      movx=setInterval("mov("+a+")",time)
      }
    function movover(){
      clearInterval(movx)
      }
      function mov(a){
      scrollx=new_date.document.body.scrollLeft
      scrolly=new_date.document.body.scrollTop
      scrolly=scrolly+a
      new_date.window.scroll(scrollx,scrolly)  
      }
    function o_down(theobject){
      object=theobject
      while(object.filters.alpha.opacity>60){
      object.filters.alpha.opacity+=-10}
      }
    function o_up(theobject){
      object=theobject
      while(object.filters.alpha.opacity<100){
      object.filters.alpha.opacity+=10}
      }
    function wback(){
      if(new_date.history.length==0){window.history.back()}
      else{new_date.history.back()}
      }
    </script> 
    <img src="images/up.gif" width=19 height=27 class="opacity" onMouseDown=movover();movstar(-3,2) onMouseOut=movover();o_up(this) onMouseOver=movstar(-1,20);o_down(this)onMouseUp=movover();movstar(-1,20) alt="点住不放可以快速向上滚动">
    <img src="images/down.gif" width=19 height=19 class="opacity" onMouseDown=movover();movstar(3,2) onMouseOut=movover();o_up(this) onMouseOver=movstar(1,20);o_down(this) onMouseUp=movover();movstar(1,20) alt="点住不放可以快速向下滚动">
    <iframe border=0 frameborder=0 framespacing=0 height=120 marginheight=0 marginwidth=0 name=new_date noResize scrolling=no src="iframe.htm" width=200 vspale="0"></iframe>
      

  3.   

    <SCRIPT language="javascript">
    function movX(a){
    scrollx=biao.document.body.scrollLeft;
    scrolly=biao.document.body.scrollTop;
    scrollx=scrollx+a;
    biao.window.scroll(scrollx,scrolly);
    }
    function movstarX(a,time){
    movY=setInterval("movX("+a+")",10);
    }
    function movstar(a,time){                    ]
    movx=setInterval("mov("+a+")",10);
    }
    function movover(){                        
    clearInterval(movx);
    }
    function movoverY(){
        clearInterval(movY);
    }
    function mov(a){                      
    scrollx=biao.document.body.scrollLeft;
    scrolly=biao.document.body.scrollTop;
    scrolly=scrolly+a;
    biao.window.scroll(scrollx,scrolly);
    }
    </script>
    <A class=opacity href="javascript:void(0)" 
      onmousedown=movover();movstar(-9,2) 
          onmouseover=movstar(-2,20) onmouseout=movover() 
          onmouseup=movover();movstar(-1,20)>up</A>   //向下滚动<A class=opacity href="javascript:void(0)"
          onmousedown=movover();movstar(9,2) 
          onmouseover=movstar(2,20) onmouseout=movover() 
          onmouseup=movover();movstar(1,20)>down</A>   //向下滚动
    <a class=opacity href="javascript:void(0)" 
    onmouseout=movoverY() onmouseover=movstarX(2,20)
    onmousedown=movoverY();movstarX(5,2)
    onmouseup=movoverY();movstarX(1,20) >
    left</a>   //向左滚动
    <a class=opacity href="javascript:void(0)" 
    onmouseout=movoverY() onmouseover=movstarX(-2,20) 
    onmousedown=movoverY();movstarX(-5,2)
    onmouseup=movoverY();movstarX(-1,20)>   //向右滚动