zoukankan      html  css  js  c++  java
  • div 无缝滚动

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=gbk">
    <title></title>
    
    <style type="text/css">
    BODY {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px;  PADDING-BOTTOM: 0px; MARGIN: 0px auto; COLOR: #333333; PADDING-TOP: 0px; FONT-FAMILY: "宋体"; TEXT-ALIGN: center
    }
    * {
        BACKGROUND-IMAGE: none;  background-color:#FAFBF5
    }
    #scrollWrap {
        OVERFLOW: hidden; BORDER-LEFT-STYLE: none; HEIGHT: 25px
    }
    #scrollMsg {
        PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FLOAT: left; PADDING-BOTTOM: 0px; WIDTH: 680px; PADDING-TOP: 0px; TEXT-ALIGN: left
    }
    #scrollMsg UL {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px;float:left
    }
    #scrollMsg LI {
        LINE-HEIGHT: 25px; LIST-STYLE-TYPE: none
    }
    </style>
    
    </head>
    <body>
    <div id="scrollWrap">
    <div id="scrollMsg">
    <ul>
      <li><font color="#069138">《三字经》</font>&nbsp;&nbsp;人之初  性本善  性相近  习相远  苟不教  性乃迁
      <font color="#ff0000">《三字经》</font>
      </li>
      <li><font color="#069138">《三字经》</font>&nbsp;&nbsp;教之道  贵以专  昔孟母  择邻处  子不学  断机杼
      <font color="#ff0000">《三字经》</font>
      </li>
      <li><font color="#069138">《三字经》</font>&nbsp;&nbsp;窦燕山  有义方  教五子  名俱扬  养不教  父之过
      <font color="#ff0000">《三字经》</font>
      </li>
      <li><font color="#069138">《三字经》</font>&nbsp;&nbsp;教不严  师之惰  子不学  非所宜  幼不学  老何为
      <font color="#ff0000">《三字经》</font>
      </li>
      <li><font color="#069138">《三字经》</font>&nbsp;&nbsp;玉不琢  不成器  人不学  不知义  为人子  方少时
      <font color="#ff0000">《三字经》</font>
      </li>
     </ul></div>
      </div>
    <script type="text/javascript"> 
        <!-- 
        try{ 
         var isStoped = false; 
         var oScroll = document.getElementById("scrollWrap"); 
         with(oScroll){ 
         noWrap = true; 
         } 
         
         oScroll.onmouseover = new Function('isStoped = true'); 
         oScroll.onmouseout = new Function('isStoped = false'); 
         
         var preTop = 0; 
         var curTop = 0; 
         var stopTime = 0; 
         var oScrollMsg = document.getElementById("scrollMsg");
         
         oScroll.appendChild(oScrollMsg.cloneNode(true)); 
         init_srolltext(); 
        }catch(e) {} 
         
        function init_srolltext(){ 
         oScroll.scrollTop = 0; 
         setInterval('scrollUp()', 20); 
        } 
         
        function scrollUp(){ 
         if(isStoped) return; 
         curTop += 1; 
         if(curTop == 26) { 
         stopTime += 1; 
         curTop -= 1; 
         if(stopTime == 120) { 
         curTop = 0; 
         stopTime = 0; 
         } 
         }else{ 
         preTop = oScroll.scrollTop; 
         oScroll.scrollTop += 1; 
         if(preTop == oScroll.scrollTop){ 
         oScroll.scrollTop = 0; 
         oScroll.scrollTop += 1; 
         } 
         } 
        } 
        //--> 
        </script>
    </body></html>
  • 相关阅读:
    js积累点
    org.hibernate.NonUniqueObjectException
    SSH框架下的表单重复提交
    ajax传输中文参数乱码,本地使用tomcat不乱码,liunx+weblogic乱码
    启动weblogic报错:string value '2.4' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/javaee
    weblogic启动项目,设置内容、设置的数据源链接不生效
    myeclipse编译弹框:The builder launch configuration could not be found
    tomcat启动项目报错:The specified JRE installation does not exist
    Mac上的jdk
    前端
  • 原文地址:https://www.cnblogs.com/linsu/p/4790599.html
Copyright © 2011-2022 走看看