// ===========自动滚屏=============
        function ScrollList(name){
            this.list=document.getElementsByClassName(name)[0]
            this.prize_scroll=null
            var that=this
            this.list.addEventListener('mouseenter',function(){
                clearInterval(that.prize_scroll)
            })
            this.list.addEventListener('mouseleave',function(){
                that.init()
            })
        this.init=function(){
                clearInterval(that.prize_scroll)
                that.prize_scroll=setInterval(function(){
                    
                    that.list.scrollTop+=1
                    if(that.list.scrollTop==that.list.scrollHeight-that.list.offsetHeight){
                        
                        that.list.scrollTop=0
                    }
                },100)
            }
            
        }
    var scroll1=new ScrollList('tcont')//tcont需要overflow:auto
    scroll1.init()

 

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
相关资源
相似解决方案