Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Caută ajutor

Atenție la excrocheriile de asistență. Noi nu îți vom cere niciodată să suni sau să trimiți vreun SMS la vreun număr de telefon sau să dai informații personale. Te rugăm să raportezi activitățile suspecte folosind opțiunea „Raportează un abuz”.

Află mai multe
Rezolvat Arhivate

"wheel" event not inplemented in Linux - still need to use non-standard "DOMMouseScroll"

StewVed

Using Ubuntu (any recent version), which is Debian-based, Firefox (any recent version) doesn't appear to recognise the Standardized wheel event, "wheel" as described here: https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel.

The only one that appears to with is the old, and non-standard "DOMMouseScroll" : https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/DOMMouseScroll

Is this the same in Windows/Mac versions of Firefox?

In addition, in the example code: // detect available wheel event

   support = "onwheel" in document.createElement("div") ? "wheel" : // Modern browsers support "wheel"
             document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel"
             "DOMMouseScroll"; // let's assume that remaining browsers are older Firefox

doesn't seem to choose DOMMouseScroll, so perhaps the support is there, but somhow not fired?

Using Ubuntu (any recent version), which is Debian-based, Firefox (any recent version) doesn't appear to recognise the Standardized wheel event, "wheel" as described here: https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel. The only one that appears to with is the old, and non-standard "DOMMouseScroll" : https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/DOMMouseScroll Is this the same in Windows/Mac versions of Firefox? In addition, in the example code: // detect available wheel event support = "onwheel" in document.createElement("div") ? "wheel" : // Modern browsers support "wheel" document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel" "DOMMouseScroll"; // let's assume that remaining browsers are older Firefox doesn't seem to choose DOMMouseScroll, so perhaps the support is there, but somhow not fired?

Toate răspunsurile (3)

Linux distros typically provide their own version of Firefox, where prefs like that may not be the same as what Mozilla supplies in Linux versions which are available directly from Mozilla servers. And the Mozilla Linux version may have a pref like that set differently than on the Mac OSX and Windows versions of Firefox.

Soluție aleasă

Never mind m8, I was using event.detail instead of event.deltaY - looks like deltaY is the way to go... my bad - Firefox (Linux) DOES support the new standard "wheel" event after all :D

See also:

  • bug 18542 - onmousewheel attribute should be replaced with onwheel

Modificat la de cor-el