http://jsfiddle.net/bxB9C/滾動造成鼠標離開火在IE
的鼠標離開正在向上滾動時上下打響了IE僅
滾動在黃色框的例子在IE中看到的問題。
有什麼辦法可以阻止這種情況發生?
$("#box").mouseenter(function(){
$("#mouse").html("mouseenter");
}).mouseleave(function(){
$("#mouse").html("mouseleave");
});
$("#box").bind('mousewheel DOMMouseScroll MozMousePixelScroll', function(e){
var theEvent = e.originalEvent.wheelDelta || e.originalEvent.detail*-1
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
if(theEvent /120 > 0) {
$("#scroll").html("Scrolling Up");
}
else{
$("#scroll").html("Scrolling Down");
}
return false;
});
您的代碼似乎正常工作(IE 9,也在Comp。模式)。 – Pieter
即時通訊使用IE10 當在黃色框中向下滾動幾秒鐘時,鼠標離開被觸發 – eleven11