Reputation: 43447
The mousewheel event's target
property provides the DOM element that the mouse is currently hovering over as the mousewheel (or gesture-capable touchpad) is being operated.
When I do this (at least in Safari 6, I will test other browsers later) I will get the text node itself as target
.
This never happens with other events which always produce a non text node even if I perform the action directly over text.
Needless to say it makes the code more complex than otherwise.
Is there a reason for this? I'd like to avoid having to check the parent node, though thankfully the nice thing about this situation is that I would only ever need to check the target
node's parent.
I can't decide if this is a feature or a bug.
Upvotes: 6
Views: 1277