我遇到了在IE8中使用jQuery窗口連接mousedown事件的問題。我沒有收到任何錯誤,但事件似乎並未解僱。它在IE9和我嘗試過的所有其他瀏覽器中都能正常工作。這裏是我的代碼:在IE8中jQuery mousedown事件沒有觸發窗口
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function test(e) {
alert('test');
}
$(document).ready(function() {
$(window).mousedown(test);
});
</script>
</head>
<body>
</body>
</html>
你可以用.click()來轉義不一致的mousedown處理(特別是在Opera和IE中)嗎? – Interrobang