js w页面返回顶部失效

179 阅读1分钟

需要同时设置两个属性, 不然对某些机型不支持。

 document.body.scrollTop = document.documentElement.scrollTop = 0;