本帖最后由 yhyynh1986 于 2009-11-20 16:21:57 编辑

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <HTML xmlns="http://www.w3.org/1999/xhtml">
    <HEAD>
    <TITLE>CSDN Demo</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=utf-8">
    <STYLE type=text/css> 
      <!--  
      body  {  
      margin:0;  
      background:#eaeaea;  
      }  
      -->  
    </STYLE>
    <script language="javascript"></script>
    </HEAD>
    <BODY>
    <table  width="165"  border="0"  cellpadding="0"  cellspacing="0">
      <tr>
        <td><table  width="160"  border="0"  cellspacing="0"  align="center">
            <tr>
              <td>
       <div  id="EPA1"  style="width:151px;">
                  <a  href="http://www.teamsun.com.cn/"  target="_blank"> <img  src="http://www.baidu.com/img/baidu_logo.gif"  width="151"  height="42"  border="0" alt="1"> </a><a  href="http://sh.delteq.com.cn"  target="_blank"> <img  src="http://www.baidu.com/img/baidu_logo.gif"  width="151"  height="42"  border="0"alt="2"> </a><a  href="http://www.digitalchina.com/"  target="_blank"> <img  src="http://www.baidu.com/img/baidu_logo.gif"  width="151"  height="42"  border="0" alt="3"> </a>
                </div>
                <div  id="EPA2"  style="position:absolute;z-index:1;visibility:hidden"> </div></td>
            </tr>
          </table></td  >
      </tr>
    </table>
    <script>  
      articleWidth=453;  
      stopscrolla=false;  
      document.getElementById("EPA1").scrollTop=0;  
      with(document.getElementById("EPA1")){  
          style.height="47px"; 
          style.width=articleWidth+"px";   
          style.overflow="hidden";  
          noWrap=true;  
          onmouseover=new  Function("stopscrolla=true");  
          onmouseout=new  Function("stopscrolla=false");  
      }  
        
      preTopa=0;  currentTopa=0;  stoptimea=0;  
        
      function  init_srolltext1(){  
          document.getElementById("EPA2").innerHTML="";  
          document.getElementById("EPA2").innerHTML+=document.getElementById("EPA1").innerHTML;          
          document.getElementById("EPA1").innerHTML=document.getElementById("EPA2").innerHTML+document.getElementById("EPA2").innerHTML;  
          setInterval("scrollUp1()",10);  
      }  
      function  scrollUp1(){  
          if(stopscrolla==true)  return;  
          currentTopa+=1;  
          if(currentTopa==151)  
          {  
            stoptimea+=1;  
            currentTopa-=1;  
            if(stoptimea==151)    
            {  
              currentTopa=0;  
              stoptimea=0;  
            }  
          }  
          else  {        
            preTopa=document.getElementById("EPA1").scrollLeft;  
            document.getElementById("EPA1").scrollLeft+=1;  
            if(preTopa==document.getElementById("EPA1").scrollLeft){  
               document.getElementById("EPA1").scrollLeft=document.getElementById("EPA2").offsetWidth-articleWidth;  
                document.getElementById("EPA1").scrollLeft+=1;  
            }  
          }  
        
      }  
      init_srolltext1();  
      </script>
    <script language='javascript'></script>
    </BODY>
    </HTML>