Javascript获取页面滚动条的位置

Javascript获取滚动条的位置.(代码来源于网络)

js
function getScroll()  {     
var t, l, w, h;          
if (document.documentElement && document.documentElement.scrollTop) {         
= document.documentElement.scrollTop;         
= document.documentElement.scrollLeft;         
= document.documentElement.scrollWidth;         
= document.documentElement.scrollHeight;     
else if (document.body) {
= document.body.scrollTop;         
= document.body.scrollLeft;         
= document.body.scrollWidth;         
= document.body.scrollHeight;     
}     
return { t: t, l: l, w: w, h: h }; 
}  
原文地址:https://www.cnblogs.com/KenBlove/p/1351708.html