Did you know that Mozilla doesn’t fire the scroll event when you scroll a page with the mousewheel? Pretty annoying, that. However, I have just discovered that it does fire the DOMMouseScroll event. So, if you’re annoyed that using the mouse wheel doesn’t give you a scroll event, trap the DOMMouseScroll event instead, with window.addEventListener('DOMMouseScroll', scroll_function, false). Quite why this inconsistency exists escapes me a bit, but now there’s a solution.
Tip: In Mozilla, never put the beer at the bottom of the page and reply on the ’scroll’ event to get there.
Thanks Stuart :)
Posted by Dustin Diaz on October 1st, 2005.
*rely – not reply ;)
Posted by Dustin Diaz on October 1st, 2005.
[...] There are times when this weblog is silent because I’m not up to much. There are also times when it’s silent because I’m up to too much and don’t have time to post. This most recent silence has been the latter sort, although a couple of nuggets (like the thing about mousewheel scrolling and the thing about defineSetters came out of my current work. Still not ready to reveal it, but I do have one other thing to say: I’m going to SxSW 2006! Yes indeed. I shall be there in Austin. I got well sick last year of everyone going on about it, and Simon ragged on me for thinking about not going, pointing out that it is great and fantastic and now he works at Yahoo, and I examined his argument and found it compelling. We’ll ignore, for the moment, all the 64oz steaks for $0.99 that you get in Texas, although I shall not be ignoring them when I get there, no sirree. Bring me another. And another plate of chips, too. Oh yes. Anyway, I’m really looking forward to it. It’s going to be cool. I’m also speaking at a couple of upcoming conferences; details when they go public. Blimey — jetting off to other countries, speaking at conferences…I’m turning into Jono. Heh. [...]
Posted by as days pass by » Off to Austin on October 3rd, 2005.
Tnx a lot, you saved me some agony.
Posted by Zs on January 6th, 2006.
Thank you!!! It’s that I want!
Posted by Rom@nych on January 11th, 2006.
Ahhhh! This has been a pain for such a long time! Thank you :)
Posted by GôTô on May 31st, 2006.
Saved me too!
Thank you for sharing with all!
Posted by Leena Kulkarni on January 9th, 2007.
Thanks, this just answered my question very well. Note, though, that FF 2.0 uses the scroll event like everybody else. This tip still applies for FF1.5.
Tom
Posted by Tom Lancaster on March 10th, 2007.