mouseWheel in Safari not active?


#1

Hello all!

Just signed up today and excited to be part of the forum. I am wondering if there is a way to activate mouseWheel in safari? For me, the example at p5.org doesn’t work in safari, and the page I am trying to build works in Chrome, but not safari.

Thank you for any tips in advance !!


#2

I think that the mouseWheel() event isn’t well supported by Safari, and others brothers actually ; it’s not a standard : https://developer.mozilla.org/en-US/docs/Web/API/MouseWheelEvent
Moreover, using mouseWheel() with event.delta can creates troubles, because the scroll of the mouse can be inverted by users in their settings and I also think that the Mac scroll and Windows / Linux scroll aren’t in the same direction, so values can be negatives instead you expected positives values


#3

Understood! Thank you so much for the reply. Do you have any alternative suggestions on how to achieve such an effect?

Basically I am trying to have a sketch that is aware of the current scroll position. Obviously there are ways to do various jQuery scroll tracking, but I hadn’t seen an effective way to do it with p5.

Thanks again!!


#4

FWIW I just tried the scroll event and it appears this isn’t working on Safari either.


#5

Unfortunately, I don’t know how to do, even with JQuery wich get the positions of html element, relative to the scrollbar position I think. I don’t know if it can be apply for a canvas…
But if someone else has a solution I also would be glad to hear it !