http://www.quirksmode.org/dom/events/mousemove.html對IE8進行處理文檔,但沒有窗戶鼠標移動事件,但我目前有:在IE8和以前版本中如何處理mousemove?
try
{
document.onmousemove = drag.on_mouse_move;
}
catch(error)
{
if (typeof document.attachEvent !== undefined)
{
document.attachEvent("onmousemove", drag.on_mouse_move);
}
}
第一個真正的語句拋出在IE8的錯誤,一樣的最後一條語句。後一個錯誤聲稱類型不匹配;前一個錯誤會引發「未執行」。如何在IE8(/ 7/6)中註冊一個mousemove事件監聽器?
也許你可以製作[jsfiddle](http://jsfiddle.net)? –
爲什麼要處理這個問題時,jQuery爲您處理跨瀏覽器問題,特別是如果你正在處理舊瀏覽器! – frenchie
它傷心如何純粹JS失去了贊成「只使用jQuery」...... – MalSu