1
我有以下的HTML代碼:Jquery的委託滾動事件
<div id="scroll-box">
<div id="header" style="position:fixed">...</div>
<div id="main">...</div>
</div>
我試圖委派的渦旋框事件的滾動事件,如果用戶滾動用鼠標懸停在標題:
$('#scroll-box').delegate('#header', 'scroll', function(){
alert("scroll");
});
這是行不通的。 即使鼠標懸停在標題上並且用戶滾動,如何觸發滾動框的滾動事件?
那麼這個問題在這裏回答。 http://stackoverflow.com/questions/16505182/bind-scroll-event-to-dynamic-div/31498537#31498537 –