时间:2021-07-01 10:21:17 帮助过:3人阅读
window.onscroll = function () {
if (document.documentElement.scrollTop + document.body.scrollTop > 100) {
document.getElementById("scrollto").style.display = "block";
}
else {
document.getElementById("scrollto").style.display = "none";
}
}
scrollto 为页面上“回到顶部”的容器(div标签)