DEV Community

Discussion on: How to create horizontal scroll with mouse wheel using JavaScript

Collapse
 
moopet profile image
Ben Sinclair

Why would you want to associate one hand movement with a different axis? And how does this behave with a touchpad or screen, where you'd be swiping from side-to-side?

Collapse
 
juanbelieni profile image
Juan Belieni

I've tested it with a screen, and it works well. But you're right, when user moves side-to-side with touchpad, it doesn't work, because of the preventDefault. When I have the time, I will update the post to include this information. Thanks!

Collapse
 
carlotamburin profile image
carlotamburin

I am currently having trouble with this. I couldn't find a method to test if the user using the trackpad and not calling preventDefault() then.