zoukankan      html  css  js  c++  java
  • js实现垂直向上滚动

    效果图:

    代码如下

    
    <!--
     * @Descripttion: 
     * @version: 
     * @Author: yang_ft
     * @Date: 2020-09-30 14:08:07
     * @github: famensaodiseng
     * @LastEditTime: 2020-10-12 09:14:59
    -->
    <!DOCTYPE html>
    <html lang="zh-CN">
    
    <head>
      <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>垂直滚动</title>
      <!-- <link rel="shortcut icon" href="favicon.ico"> -->
      <style>
        * {
          margin: 0;
          padding: 0;
        }
    
        ul li {
          list-style: none;
        }
    
        .organization {
           300px;
          height: 150px;
          border: 1px solid #000;
          overflow: hidden;
          padding: 20px;
          box-sizing: border-box;
        }
    
        .org li {
          border-bottom: 1px dashed #ccc;
        }
      </style>
    </head>
    
    <body>
      <div class="organization" id="organization">
        <div class="org" id="org">
          <ul>
            <li>1111111111111</li>
            <li>2222222222222</li>
            <li>3333333333333</li>
            <li>4444444444444</li>
            <li>5555555555555</li>
            <li>6666666666666</li>
            <li>7777777777777</li>
            <li>8888888888888</li>
          </ul>
        </div>
        <div class="org" id="org1">
        </div>
      </div>
      <script>
        var speed = 70
        org1 = document.getElementById("org1");
        org1.innerHTML = org.innerHTML
        function Marquee() {
          if (org1.offsetTop - organization.scrollTop <= 0)
            organization.scrollTop -= org.offsetHeight
          else {
            organization.scrollTop++
          }
        }
        var MyMar = setInterval(Marquee, speed)
        organization.onmouseover = function () { clearInterval(MyMar) }
        organization.onmouseout = function () { MyMar = setInterval(Marquee, speed) } 
      </script>
    </body>
    
    </html>
    
  • 相关阅读:
    python-logging配置
    python-装饰器
    python字符串操作
    python集合
    python-列表和元组
    Python 3开发网络爬虫(四): 登录
    python3中No module named 'commands'
    Python 爬虫 (三)
    零基础自学Python 3开发网络爬虫(二): 用到的数据结构简介以及爬虫Ver1.0 alpha
    零基础自学用Python 3开发网络爬虫(一)
  • 原文地址:https://www.cnblogs.com/Bianco/p/13800936.html
Copyright © 2011-2022 走看看