document.body.scrollTop vs document.documentElement.scrollTop

document.body.scrollTop vs 
document.documentElement.scrollTop
1 window.addEventListener("scroll", function () {
2         if (document.body.scrollTop >= window.innerHeight) {
3             document.getElementById("top_back").style.display = "block";
4         } else {
5             document.getElementById("top_back").style.display = "none";
6         }
7 }
document.body.scrollTop vs 
document.documentElement.scrollTop

 

document.body.scrollTop---------------->document.documentElement.scrollTop

document.body.scrollTop在手机里其作用,但是document.documentElement.scrollTop不起作用

document.body.scrollTop vs document.documentElement.scrollTop

上一篇:WPF AutoGeneratingColumn 绑定下拉框


下一篇:Readonly与const初识