Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the wheel event #917

Closed
ivmartel opened this issue Apr 30, 2021 · 4 comments
Closed

Use the wheel event #917

ivmartel opened this issue Apr 30, 2021 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@ivmartel
Copy link
Owner

The current code uses the deprecated mousewheel and DOMMouseScroll events. This must be changed to use the standard wheel event.

@ivmartel ivmartel added the enhancement New feature or request label Apr 30, 2021
@ivmartel ivmartel added this to the 0.29.0 milestone Apr 30, 2021
@ivmartel
Copy link
Owner Author

Careful will deltaY and deltaMode: browsers use different default deltaMode and deltaY seems to be OS dependent...

@ivmartel
Copy link
Owner Author

Checking current values with tryjsref_event_wheel_deltamode using this text:

<!DOCTYPE html>
<html>
<body onwheel="myFunction(event)">
<h1>WheelEvent deltaMode Property</h1>
<p>Scroll this page to see the length unit of the delta values property.</p>
<p><strong>Note:</strong> 0 = pixels, 1 = lines, 2 = pages.</p>
<p id="demo"></p>
<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;
<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;
<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;
<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;
<script>
function myFunction(event) {
  var x = event.deltaMode;
  document.getElementById("demo").innerHTML = 
    'deltaMode=' + event.deltaMode +
    ', deltaY=' + event.deltaY;
}
</script>
</body>
</html>

@ivmartel
Copy link
Owner Author

Linux Fedora 39:

  • [firefox 123] deltaMode=1, (mousewheel) deltaY=6
  • [chrome 122] deltaMode=0, (mousewheel) deltaY=120

Mac 14.4:

  • [firefox 123] deltaMode=1, (mousewheel) deltaY=1
  • [chrome 122] deltaMode=0, (mousewheel) deltaY=4

Windows 10:

  • [firefox 123] deltaMode=1, (mousewheel) deltaY=6
  • [chrome 122] deltaMode=0, (mousewheel) deltaY=100

@ivmartel
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant