Muiltiple滾動錯誤我有以下的HTML頁面在HTML頁面
<html>
<head>
<title> Test Page </title>
</head>
<body>
<div id="testdiv" style="height:300px; width:200px; overflow:scroll;">
This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div This is a sample div
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</div>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</body>
</html>
我這個頁面我添加了下面的腳本
<script>
$(window).scroll(function(){
alert('Window Scroll');
});
$('#testdiv').scroll(function(){
alert('testdiv Scroll');
});
</script>
這將提醒我哪些滾動動作被調用。
如果我的身體滾動它提醒我,Window Scroll
,如果我在一個div這是人體的提醒我爲testdiv scroll
裏面滾動,Window Scroll
,但應警惕僅testdiv scroll
爲什麼它的警報我2個滾動事件
在我的FF 30上,我沒有這個錯誤。 – Portekoi