javascript - onmousewheel, on window or document? -
i experimenting scroll events , in few scripts have looked @ found line:
window.onmousewheel = document.onmousewheel = somefunc;
this working intended, somefunc triggered on scroll. problem chrome triggering function twice (obviously because chrome responding both window , document event). know why both events used, due cross browser compatibility? if so, browser prefer event? choose 1 of events, don't know which.
if have frames in html, not included in document, , mouse wheel event won't triggered.
Comments
Post a Comment