32 Comments
- gonknet, on 10/12/2007, -3/+25I disagree. Changing the behavior of the scrollwheel is desirable in some cases, although not on your typical HTML document.
This would be useful for things like Flash. If the entire page is made of flash, the scroll-wheel is useless, so using Javascript to handle the event would be useful.
This could also be useful in things like Google Maps (they already do use it for zooming), where scrolling the page is not desired as the page does not vertically exceed the size of the browser window. - Naikrovek, on 10/12/2007, -0/+20"Er... Flash doesn't support javascript."
Yeah it does. Flash can control the browser via JavaScript and JavaScript can control the Flash movie. - hobbified, on 11/06/2007, -4/+20Okay, now that we know how to use this, _please do not ever use it_. We don't want you changing what our mousewheels do. Really.
- racemic, on 10/12/2007, -1/+9Now that the mouse wheel works in Google maps, I'm sure there will be rush to integrate wheel functionality into all rich web apps.
This is a nice description of how to access wheel event information. If you're looking for a reference for other mouse/keyboard events, I strongly suggest using http://www.quirksmode.org It catalogs almost all accessible events very well, and accounts for oddities in behavior between different browsers... - tweeto, on 10/12/2007, -3/+11Fixed...
- UnglueD, on 10/12/2007, -1/+6I got "9 up" BEAT THAT!
- riceweb, on 10/12/2007, -1/+6What on earth is wrong with JavaScript? It's an excellent, object-oriented scripting language with broad support and ECMA standards.
I don't know of any JavaScript IDEs, but then, who doesn't code everything by hand? - kvncortez, on 10/12/2007, -0/+3Nice post.. Found it useful :)
- jdkane, on 10/12/2007, -0/+3Nice solution. Whenver I see any JavaScript code, no matter how nice, I always ask: When will be the turning point when JavaScript/ECMA script namespaces exist in the most common browsers. I hope the future is friendly in this regard.
I've started encapsulating my JavaScript functions in objects as methods, to prevent functions from stepping on each other globally (or on the toes of other scripts). Of course my encapsulated scrpipt objects could step on each other but this is more rare. I call it a "pseduo" namespace technique. - Slig, on 10/12/2007, -0/+2If you´re working with Google Web Toolkit, this small class I made sometime ago might can help you
http://www.bigbold.com/snippets/posts/show/2241
Part of the code is riped from the page on this story.. - NeilSkoglund, on 10/12/2007, -1/+3http://www.duggmirror.com/programming/Mouse_wheel_programming_in_JavaScript/
- Drakazz, on 10/12/2007, -0/+2Wow, I didn't know that you can get the mouse wheel events!
Thanks, great! - BillyG123, on 11/06/2007, -1/+3you're absolutely right IRT full-Flash pages, this would be great... and yeah, I hate the new Google Maps UI, it sucks (in my FF anyway)
- jaxzin, on 10/12/2007, -0/+1My Logitech Wireless MX1000 Laser mouse has a rocker "page-scroll" button around the scroll wheel that reliably gives delta of +/-8 even after I stop clicking the rocker button.
- masterkenobi, on 10/12/2007, -2/+3I can't get into the site...is there a mirror?
- tweeto, on 10/12/2007, -0/+114 up !
but it gets back to 1 when the wheel stops. - utch, on 10/12/2007, -1/+2need a mirror for the test page : http://adomas.org/javascript-mouse-wheel/test.html sigh..
- mebob, on 10/12/2007, -0/+1Nice code! I also wasn't aware that google took advantage of it.
Luckily it's hard to just slap this into most pages, so it hopefully won't be over used. - ednopantz, on 10/12/2007, -0/+1if by "works" you mean "screws up my ability to scroll the page and instead zooms back and forth like a monkey working a microscope"..
- yenta4shop, on 09/07/2008, -0/+0http://www.yenta4shop.co.uk/
http://astore.amazon.com/12.volt.battery.charger-2 ...
http://astore.amazon.com/5.gallon.water.bottle-20
http://astore.amazon.com/aerobed.raised-20
http://astore.amazon.com/bug.zapper-20
http://astore.amazon.com/flowtron.insect.killer-20
http://astore.amazon.com/furniture.chaise.lounge-2 ...
http://astore.amazon.com/inflatable.bed-20
http://astore.amazon.com/steam.cleaner.mop-20 - yogastore, on 06/27/2008, -0/+0http://astore.amazon.com/flowtron.mosquito-20
http://astore.amazon.com/flowtron.insect.killer-20
http://astore.amazon.com/evaporative.air.cooler-20
http://astore.amazon.com/air.swamp.cooler-20
http://astore.amazon.com/braun.electric.kettle-20
http://astore.amazon.com/cordless.electric.kettle- ...
http://astore.amazon.com/canon.battery.charger-20
http://astore.amazon.com/12.volt.battery.charger-2 ...
http://astore.amazon.com/furniture.chaise.lounge-2 ...
http://astore.amazon.com/outdoor.chaise.lounge-20 - byter10, on 10/12/2007, -1/+0Here's my implementation of it:
http://www.project-atlas.com/ExtendedSlider.aspx
And the corresponding article:
http://aspadvice.com/blogs/i_3_atlas/archive/2006/07/29/20063.aspx - mebob, on 10/12/2007, -2/+0It's surprising this isn't more of a problem already. I've only bumped into it in the code I work with once or twice.
Have any examples of your "pseudo" name space technique? - untzboy, on 10/12/2007, -5/+2I love the mouse wheel. Especially in IE7Beta3
- rehsifttam, on 10/12/2007, -6/+1so...... slow..........
- ednopantz, on 10/12/2007, -6/+1wow. how irritating. Why not just change the way my keyboard works too?
- Pseudo98, on 10/12/2007, -6/+1lol, you tell 'em!
- Grimdotdotdot, on 10/12/2007, -10/+3I'm pretty sure the mouse wheel only works in Google Maps only works because Live Maps used it first.
See you at -54, MS antifanboys! - tweeto, on 10/12/2007, -12/+4It's all nice and good but the test page doesn't working... :(
- untzboy, on 10/12/2007, -9/+1"Below is annotated javascript code, which should make easy to get the way events get handled. There is also plain version for copy and paste."
Reminds me of 10 Signs You're a Bad Programmer... and Don't Know It
Not to mention Java Script..... - strictnein, on 10/12/2007, -14/+3@hobbified:
no kidding. Google maps uses it to zoom in and it out and I hate it. - Grimdotdotdot, on 10/12/2007, -19/+1Er... Flash doesn't support javascript.


What is Digg?