为什么ie下的onscroll事件轮滚过快就执行了2次呢?
鼠标轮滚过快就执行了2次document.title +=ss;
如果点击滚动条手动拉动的话就正常
有什么办法解决吗?
如果点击滚动条手动拉动的话就正常
有什么办法解决吗?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
*{ margin:0;padding:0; }
#wrap{ width:980px;position:relative;margin:0 auto; }
body{ height:1100px }
</style>
</head>
<body>
<script type="text/javascript">
function log(i){ return console.log(i); }
var $ = function(id){ return typeof id == "string" ? document.getElementById(id) : id };
window.onscroll = function(){
var tops =0;
if(document.body.scrollTop){
tops = document.body.scrollTop;
}
else{
tops = document.documentElement.scrollTop;
}
if(tops >= document.documentElement.scrollHeight - document.documentElement.clientHeight){
var ss="1";
document.title +=ss;
}
}
</script>
</body>
</html>
...全文
相关推荐
关于onScroll事件在IE6下每次滚动触发三次bug说明
今天测试发现IE6下用[removed],每次滚动时会触发3次,而火狐、IE7没此问题,应该是IE6的一个BUG
js网页滚动条滚动事件实例分析
主要介绍了js网页滚动条滚动事件的用法,实例分析了javascript中[removed]监控滚动条滚动事件的相关技巧,需要的朋友可以参考下
JS 滚动事件[removed]与position:fixed写兼容IE6的回到顶部组件
主要介绍了JS 滚动事件[removed]与position:fixed写兼容IE6的回到顶部组件的相关资料,需要的朋友可以参考下
CSS在网页上实现浮动层跟随滚动条特效(兼容IE6)
CSS在网页上实现浮动层跟随滚动条特效(兼容IE6)
javascript ie6兼容position:fixed实现思路
positon:fixed 让HTML元素脱离文档流固定在浏览器的某个位置 网页中经常会有浮动的导航条会用到这种定位模式,但是ie6下并不兼容这种定位 浮动导航条的样式,重要的是position:fixed;bottom:60px;(浮动导航底部距离窗口底部60px) 代码如下: .floating_9677{position:fixed; z-index:961; bottom:60px;} ie6下positon:fixed不起作用,只能靠js来实现了,首先在ie6下需要将position设置为absolute 代码如下: position:fixed;bottom:60px;_po


