关于滑动条滚动 scroll兼容
生活随笔
收集整理的这篇文章主要介绍了
关于滑动条滚动 scroll兼容
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
Ie浏览器上必须写$(window)
<script type="text/javascript">
$(function(){$(window).scroll(function(){
alert("ss");
})
})
</script>
为窗口添加滚动条事件其实非常的简单,
window.οnscrοll=function(){}; 注意在获取滚动条距离的时候 谷歌不识别document.documentElement.scrollTop,必须要加上document.body.scrollTop;即 var scrolltop=document.documentElement.scrollTop||document.body.scrollTop; 这样才能兼容各个浏览器!总结
以上是生活随笔为你收集整理的关于滑动条滚动 scroll兼容的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: Linux监控软件之 Cacti
- 下一篇: 开博第一发