zoukankan      html  css  js  c++  java
  • js 文字横向滚动


    <html>
    <head>
    <title>index</title></head>
    <body>
        <div id="demo" style="overflow: hidden; height: 20; 500; background: #f4f4f4; 
            color: #ffffff">
            <div id="demo1">
                <div style="height: 20; 1000;">123456789123456789</div></div>
        </div>
     <input type="text" id="sl" ></input>
     <input type="text" id="sw" ></input>
        <script type="text/javascript">
            var speed = 25;
            //demo2.innerHTML = demo1.innerHTML;
            function Marquee() {
               if(demo.scrollLeft>=demo.clientWidth ){
       demo.scrollLeft=0;
        }
        else{
         demo.scrollLeft++;
         document.getElementById("sl").value=demo.scrollLeft;
         document.getElementById("sw").value=demo.clientWidth;
        }
            }
            var MyMar = setInterval(Marquee, speed);
            demo.onmouseover = function () { clearInterval(MyMar) };
            demo.onmouseout = function () { MyMar = setInterval(Marquee, speed) };
        </script>
    </body>
    </html>
  • 相关阅读:
    SQL语句的优化(转载)
    使用经纬度得到位置Geocorder
    android自带下拉刷新SwipeRefreshLayout
    线程池ScheduledThreadPool
    线程池SingleThreadPool
    线程池CachedThreadPool
    线程池FixedThreadPool
    线程池ThreadPoolExecutor
    Bitmap缩放(三)
    Bitmap缩放(二)
  • 原文地址:https://www.cnblogs.com/xm_cpppp/p/2768218.html
Copyright © 2011-2022 走看看