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

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -