Javascript获取页面滚动条的位置

mac2022-06-30  57

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

js function getScroll()  {     var t, l, w, h;          if (document.documentElement && document.documentElement.scrollTop) {         t = document.documentElement.scrollTop;         l = document.documentElement.scrollLeft;         w = document.documentElement.scrollWidth;         h = document.documentElement.scrollHeight;     } else if (document.body) {t = document.body.scrollTop;         l = document.body.scrollLeft;         w = document.body.scrollWidth;         h = document.body.scrollHeight;     }     return { t: t, l: l, w: w, h: h }; }  

转载于:https://www.cnblogs.com/KenBlove/archive/2008/12/10/1351708.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)