我有以下的html页面。当我滚动鼠标时,为什么警告不起作用?jQuery滚动绑定不起作用
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(window).scroll(function(){
alert("scrolling");
});
</script>
</head>
<body>
</body>
</html>
编辑:它的工作原理当页面右侧的滚动条和滚动页面向下移动。但是我希望它在空白页面上工作,例如。
EDIT2:我已将document.body更改为窗口,但具有相同的问题。
EDIT3:那么,我来结果是我要赶鼠标滚轮事件
你是否尝试绑定到身体以及HTML? $(“body,html”) – 2012-02-01 09:23:39
我试过了,没有结果 – 2012-02-01 09:26:59
你应该如何滚动空白页? % - ( – 2012-02-01 09:42:26