ie8onScroll事件多次激活问题
<script>
var s=0;
$(document).ready(function(){
$(window).scroll(function(){
var t=$(window).scrollTop();
setTimeout(function(){
if(t!=2000){
$("#msg").html(++s);
$(window).scrollTop(2000);
}
},1000);
});
});
</script>
<div style="height:5000px"></div>
<div id="msg" style="position:fixed;width:100px"></div>
var s=0;
$(document).ready(function () {
var timer;
$(window).scroll(function () {
if (timer) clearTimeout(timer)////
timer = setTimeout(function () {/////
var t = $(window).scrollTop();
setTimeout(function () {
if (t != 2000) {
$("#msg").html(++s);
$(window).scrollTop(2000);
}
}, 1000);
}, 10);
});
});