zoukankan      html  css  js  c++  java
  • 兼容IE和FireFox的间隔滚动代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
    <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>">
    <head>
    <title>MingBlog.com - 兼容IE和FireFox的间隔滚动代码</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <style type="text/css">
    <!--
    body {
    text-align:center;
    }
    ul{
    margin:0px;
    padding:0px;
    list-style:none;
    }
    #andyscroll {
    overflow: hidden;
    background: #E8F8F8;
    padding: 0 10px;
    text-align: left;
    400px;
    height:100px;
    overflow:hidden;
    }
    #andyscroll a {
    font:12px/18px tahoma;
    color: #000; 
    float:left;
    100%;
    text-decoration: none;
    display:block;
    }
    #andyscroll a:hover {
    font:12px/18px tahoma;
    color: #F60;
    }
    -->
    </style>
    </head>
    <body>
    <div id="andyscroll">
    <div id="scrollmessage">
    <UL><li><a href="#">完全兼容IE, FF, Opera, 其它的还未经测试……</a></li>
    <li><a href="#">代码来自互联网,我只不过稍加整理,希望大家多提意件……</a></li>
    <li><a href="#">完全兼容IE, FF, Opera, 其它的还未经测试……</a></li>
    <li><a href="#">代码来自互联网,我只不过稍加整理,希望大家多提意件……</a></li>
    <li><a href="#">完全兼容IE, FF, Opera, 其它的还未经测试……</a></li>
    <li><a href="#">代码来自互联网,我只不过稍加整理,希望大家多提意件……</a></li>
    <li><a href="#">完全兼容IE, FF, Opera, 其它的还未经测试……</a></li>
    <li><a href="#">代码来自互联网,我只不过稍加整理,希望大家多提意件……</a></li>
    <li><a href="#">完全兼容IE, FF, Opera, 其它的还未经测试……</a></li>
    <li><a href="#">代码来自互联网,我只不过稍加整理,希望大家多提意件……</a></li>
    <li><a href="#">完全兼容IE, FF, Opera, 其它的还未经测试……</a></li>
    <li><a href="#">代码来自互联网,我只不过稍加整理,希望大家多提意件……</a></li>
    <ul>
    </div>
    </div>
    <script type="text/javascript">
    <!--
    var stopscroll = false;
    var scrollElem = document.getElementById("andyscroll");
    var marqueesHeight = scrollElem.style.height;
    scrollElem.onmouseover = new Function('stopscroll = true');
    scrollElem.onmouseout  = new Function('stopscroll = false');
    var preTop = 0;
    var currentTop = 0;
    var stoptime = 0;
    var leftElem = document.getElementById("scrollmessage"); 
    scrollElem.appendChild(leftElem.cloneNode(true));
    init_srolltext();
    function init_srolltext(){
    scrollElem.scrollTop = 0;
    setInterval('scrollUp()', 25);//的面的这个参数25, 是确定滚动速度的, 数值越小, 速度越快
    }
    function scrollUp(){
    if(stopscroll) return;
    currentTop += 2; //设为1, 可以实现间歇式的滚动; 设为2, 则是连续滚动
    if(currentTop == 19) {
    stoptime += 1;
    currentTop -= 1;
    if(stoptime == 180) {
    currentTop = 0;
    stoptime = 0;
    }
    }else{
    preTop = scrollElem.scrollTop;
    scrollElem.scrollTop += 1;
    if(preTop == scrollElem.scrollTop){
    scrollElem.scrollTop = 0;
    scrollElem.scrollTop += 1;
    }
    }
    }
    //-->
    </script>
    </body>
    </html>
  • 相关阅读:
    封装一个php语言的api提示类
    Content-Type四种常见取值
    postman中 form-data、x-www-form-urlencoded、raw、binary的区别
    ansible find
    Linux系统中根目录下或者新挂载的磁盘目录下有一个叫lost+found,它的作用是什么?
    rm /mv需要注意的
    mount
    es number_of_shards和number_of_replicas
    logstash设置配置路径
    ES7.8 设置 xpack
  • 原文地址:https://www.cnblogs.com/top5/p/1901310.html
Copyright © 2011-2022 走看看