好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

JS检测滚动条的实时滚动距离

function getScrollOffset() {

 if (window.pageXOffset) {

 return {

 x: window.pageXOffset,

 y: window.pageYOffset

 }

 } else {

 return {

 x: document.body.scrollLeft + document.documentElement.scrollLeft,

 y: document.body.scrollTop + document.documentElement.scrollTop

 }

 }

}


查看更多关于JS检测滚动条的实时滚动距离的详细内容...

  阅读:7275次