js 设置 页面或div容器 滚动scroll


 
 
 window.scrollTo(0, 0)
   document.documentElement.scrollTop  = 0


//
参考业务代码 this.$nextTick(() => { document.getElementById('comic').scrollTop = 0 this.spinningFlag = false window.scrollTo(0, 0) setTimeout(_ => { this.noRecmdBtnLoading = false this.recmdBtnLoading = false }) }) this.$nextTick(() => { if (this.queryParam.sp_type == '1' && document.getElementById('comic')) { document.getElementById('comic').scrollTop = 0 } else if (this.queryParam.sp_type == '2' && document.getElementById('avg')) { document.getElementById('avg').scrollTop = 0 } else if (this.queryParam.sp_type == '3' && document.getElementById('drama')) { document.getElementById('drama').scrollTop = 0 } this.spinningFlag = false })

 

 

 

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM