baozhengrui

导航

上下进行翻滚样式

方法

startScroll(){
  this.interval = setInterval(()=>{
    this.offset -= this.rowHeight
    if(Math.abs(this.offset)>= this.rowHeight){
      this.offset = 0;
      this.moveFirstToLast();
    }
  },8000);
}
stopScroll(){
  clearInterval(this.interval)
}
moveFirstToLast(){
  const firstRow = this.topRightListOne.shift() // topRightListOne 数组
  if(firstRow){
    this.moveFirstToLast.push(firstRow)
   }
}

posted on 2025-03-12 10:08  芮艺  阅读(14)  评论(0)    收藏  举报