JQuery问题:为什么't $(document).scroll()不能在IE中工作?

JQuery Problem: Why doesn't $(document).scroll() work in IE?

本文关键字:不能 scroll IE 工作 问题 document 为什么 JQuery      更新时间:2023-09-26

这个简单的代码可以在firefox中工作,但不能在IE(8及以下)中工作。有办法让它起作用吗?

$(document).scroll(function() {
    alert('foo');
});

我只是想检测用户何时在页面上滚动

你可以尝试使用$(window).scroll()