zoukankan      html  css  js  c++  java
  • 文字横向移动效果

     <ul class="rescue-ul" >
          <li class="rescue-list" v-for="(item,index) in list" :key="index" > 
            <div class="rescue-list-content">
              <div class="list-marque" ref="marque" :class="moveText(item.tag)" >
                <div class="oh">
                  <span class="rescue-name" :title="item.elevatorName">{{item.elevatorName}}</span>
                  <span class="fr">{{item.alarmTime}}</span>
                </div>              
              </div>
              <!-- 移动的文字特效要两个实现 -->
              <div class="list-marque2" v-if="item.tag">
                <div class="oh">
                  <span class="rescue-name" :title="item.elevatorName">{{item.elevatorName}}</span>
                  <span class="fr">{{item.alarmTime}}</span>
                </div>    
               
              </div>
            </div>                
          </li>
        </ul>
    

      

    export default {
      data(){
        return {
          list: [{
            elevatorName: '深感产业园1栋1单元',
            alarmTime: '2020-12-02',
            tag: true
          },{
            elevatorName: '奥里奥克1栋1单元',
            alarmTime: '2020-12-06',
            
          }]
        }
      },
    
      methods: {
        // 根据tag 为true 判断是新增接警 当前接警文字移动
        moveText(tag){
          if(tag){
            return 'marque-text'
          }
        },
      }
    }
    

      

    .rescue-ul {
      height: 100%;
       100%;
      margin-top: 10px;
      overflow: hidden;
    }
    .rescue-list {
      border-bottom: 1px #0D1431 solid;
      cursor: pointer;
      display: flex;
      overflow: hidden;
      align-items: center;
      height: 50%;
    }
    .rescue-list:last-child{
      border- 0;
    }
    .rescue-list-content {
      flex: 1;
      margin-left: 10px;
      position: relative;
      height: 30px;
      overflow: hidden;
    }
    .list-marque {
      position: absolute;
      left: 0;
       100%; 
    }
    .list-marque2 {
      position: absolute;
      left: 110%;
       100%;
      box-sizing: border-box;
      animation: marquee2 15s  linear 8;
    }
    .marque-text {
      animation: marquee1 15s linear 8;
    }
    /* Make it move */
    @keyframes marquee1 {
      0% {
        left: 0;
      }
      100% {
        left: -110%;
      }
    }
    
    @keyframes marquee2 {
      0% {
        left: 110%;
      }
      100% {
        left: 0%;
      }
    }
    

      

  • 相关阅读:
    一分钟认识:Cucumber框架(一)
    迭代=冲刺?
    Nresource服务之接口缓存化
    58集团支付网关设计
    服务治理在资源中心的实践
    资源中心——连接池调优
    4种常用的演讲结构: 黄金圈法则结构、PREP结构、时间轴结构、金字塔结构
    微服务时代,领域驱动设计在携程国际火车票的实践
    Sentinel -- FLOW SLOT核心原理篇
    管理篇-如何跨部门沟通?
  • 原文地址:https://www.cnblogs.com/bm20131123/p/14074830.html
Copyright © 2011-2022 走看看