vue無縫銜接定時向上滾動滾動

   autoLoop () {  // 無縫滾動方法
      this.right.animateUp = true // 定義的一個變量,用來判斷現在是否要添加amit類
      setTimeout(() => {
        this.right.orgAmount.push(this.right.orgAmount[0])
        this.right.orgAmount.shift()
        this.right.animateUp = false
      }, 500)
    },



// css中
 .anim {
    transition: all 0.5s;
    margin-top: -32px;
  }

// html 父元素上
<div :class="right.animateUp: 'amit' : ''"></div>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章