RE: 'onmousewheel'

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I was searching for information on how successful ie6 is with 
> XML, and came
> across this:
> http://www.webreference.com/js/tips/010718.html
> I had written about something similar to ig at this very time....
> 
> I don't believe it is part of ecma262,

It's the DOM Spec it's not in rather than ecma262, ecma262 just
specifies the javascript language, not the events object models may
expose.
It would be interesting to find out whether it ends up in the DOM at
a later stage given it's very MS-centric status.

There is one slight inaccuracy in the article that may prove a
bugbear later on. It states that "The length is given in a multiple
of 120." This is currently true, and it is how the Windows API
reports mouse wheel events to application windows (winuser.h defines
WHEEL_DELTA as 120). However the choice of 120 rather than the more
obvious value of 1 is future-proofing on Microsoft's part, and it may
be advisable to future-proof along with them. The idea is that in the
future hi-res mousewheels may be more sensitive; moving the wheel the
same distance as one notch away from you would still return
WHEEL_DELTA with the WM_MOUSEWHEEL message, but turning it half as
much would return WHEEL_DELTA/2.

As such it is best to either define the numbers that describe you
actions in multiples of 120, so you can pass WHEEL_DELTA multiples
directly and get expected results, or else to look for and capture
wheelDelta values of less than WHEEL_DELTA (so if you design a page
that moves something 1 pixel every time it gets a wheelDelta of 120
you should also move the object if you get 4 wheelDelta values of 30
in a row (store the wheelDelta in a variable and act when
Math.abs(myDelta) > 120 then do your activity Math.floor(myDelta)
times and then set myDelta = myDelta % 120.

This isn't really needed ATM, but may be necessary in the future, and
it wouldn't hurt to do it now.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBO6CwNIFpv9f1Mr0YEQKVlgCfTktmmPlii5Lvh6GoE2ugooB4Ds8An36C
8RjscYEtt/26rZFQUh/fDt/J
=hW5c
-----END PGP SIGNATURE-----

Received on Thursday, 13 September 2001 09:07:04 UTC