获取滚动条移动的距离

<script>
window.onscroll=function (){
    document.getElementById('num_para').value = 'top:'+document.body.scrollTop+'  left:'+document.body.scrollLeft;	
}
</script>

<input type="text" id="num_para" value=""/>

 

你可能感兴趣的:(滚动条)