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

    <!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=utf-8" />
    <title>分享一个横向图文无缝滚动的代码,全兼容</title>
    </head>
    <body>
    <style type="text/css">
    <!--
    ul,li,div{margin:0; padding:0; font-size:12px;}
    #demo {
    678px; float:left; overflow:hidden;height:144px; border:none;
    }
    #indemo {
    float: left;
    800%;
    }
    #demo1,#demo2{height:144px;float:left; display:inline-table;}
    #demo1 li,#demo2 li{ 127px; height:144px; float:left; padding-left:8px; }
    #demo1 li img,#demo2 li img{ display:block; background:#ccc; padding:1px; border:1px solid #ccc;}
    #demo1 li span,#demo2 li span{ 127px; height:30px; line-height:30px; text-align:center; overflow:hidden;}
    #demo1 {
    float: left;
    }
    #demo2 {
    float: left;
    .lmboxb ul {
    margin-left:12px;
    margin-top:5px;
    }
    .lmboxb ul li {}
    .lmboxb ul li a {
    line-height:24px;}
    }
    -->
    </style>
    <div id="demo">
    <div id="indemo">
    <div class="lmboxb" id="demo1">
    <ul>
    <li>
    <div></div>
    <div><a href="#">春季女性补血食谱</a></div>
    </li><li>
    <div></div>
    <div><a href="#">大枣木耳汤 神情气爽</a></div>
    </li><li>
    <div></div>
    <div><a href="#">春季女性补血食谱</a></div>
    </li><li>
    <div></div>
    <div><a href="#">大枣木耳汤 神情气爽</a></div>
    </li><li>
    <div></div>
    <div><a href="#">大枣木耳汤 神情气爽</a></div>
    </li>
    </ul>
    </div>
    <div id="demo2"></div>
    </div>
    </div>
    <div style="100%;">
    </div>
    <script>
    <!--
    var speed=20; //数字越大速度越慢
    var tab=document.getElementById("demo");
    var tab1=document.getElementById("demo1");
    var tab2=document.getElementById("demo2");
    tab2.innerHTML=tab1.innerHTML;
    function Marquee(){
    if(tab2.offsetWidth-tab.scrollLeft<=0)
    tab.scrollLeft-=tab1.offsetWidth
    else{
    tab.scrollLeft++;
    }
    }
    var MyMar=setInterval(Marquee,speed);
    tab.onmouseover=function() {clearInterval(MyMar)};
    tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
    -->
    </script>
    </body>
    </html>

  • 相关阅读:
    CMDB-实例
    linux ( crontab 定时任务命令)
    2014编程之美初赛第一场题解
    单机与分布式OpenVAS在BackTrack上的配置(实验报告)
    Hadoop 2.2.0 在Red Hat Enterprise Linux 6.1 上的分布式配置(VMware虚拟机,1个namenode,2个datanode)
    Red Hat Enterprise Linux 6.1 的 JDK 1.7 安装
    TopCoder SRM 606 Div2 题解
    HDU 1561 The more, The Better (树形DP)
    HDU 2196 Computer (树形DP)
    HDU 1520 Anniversary party (树形DP)
  • 原文地址:https://www.cnblogs.com/love-Z/p/4538745.html
Copyright © 2011-2022 走看看