With Chrome, adding onmousewheel via html, such as
<table onmousewheel="myFunkl(event)">
works fine.
However this is not standard html and so cannot be used with strict XHTML.
Normally I would use the following javascript:
if (window.addEventListener)
{
myElement.addEventListener('DOMMouseScroll', myFunk, false);
}
else
{
myElement.onmousewheel = myFunk;
// or myElement.attachEvent('onmousewheel', myFunk);
}
The "then" part of the "if" statement runs, but the onmousewheel event is not added to the element.
How do you add an onmousewheel event with Javascript in Chrome?


LinkBack URL
About LinkBacks



Reply With Quote

