• 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>
  • 相关阅读:
    以流的形式将文件写入页面,直接下载
    多线程异步处理示例
    windows端口占用查看
    Spring MVC中默认的ResponseBody为String的乱码问
    inode安装
    uploadfy使用
    动态时间工具类
    常量设置
    项目配置热部署
    springboot异常:yml文件无法识别
  • 原文地址:https://www.cnblogs.com/xm_cpppp/p/2768218.html
Copyright © 2020-2023  润新知