KenBlove

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 }; 
}  

分类:

技术点:

相关文章:

  • 2021-11-17
  • 2021-08-21
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
猜你喜欢
  • 2021-07-29
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-09-16
  • 2021-11-27
  • 2021-11-17
相关资源
相似解决方案