0
如何處理javascript擴展中的鼠標滾輪事件。Chrome擴展鼠標滾輪事件
// MAIN
if (document.addEventListener) {
document.addEventListener("mousewheel", wheelHandler, false);
} else {
}
// END MAIN
function wheelHandler(e) {
alert("activated");
}
激活警報更新發生,爲什麼?
它的工作對我來說,使用Chrome 22.0.1229.79 M(Windows)中 – Mark
更新到22.0.1229.79 (Linux)仍然不起作用。你使用什麼樣的清單? – BKovac
'manifest'是什麼意思?我使用'默認'的win32安裝和一些插件(即「Image Cropper」,「CSSViewer」,「colorPicker」,「Resize Window」,「jsshell」和「MonitorTab」),但我不認爲,以任何方式重新關聯... 我也在較舊的linux VM(openSUSE 11.4,Google Chrome 16.0.912.77)上測試過它,它仍然在那裏工作。你確定,你的mousewheel事件映射正確嗎?如果你正在移動滾輪,'xev'顯示什麼?它應該映射到ButtonPress/ButtonRelease的按鈕4(上)和5(下)。 – Mark