레퍼런스 mouseWheel()

mouseWheel()

Calls a function when the mouse wheel scrolls over the element.

The callback function, fxn, is passed an event object. event has two numeric properties, deltaY and deltaX. event.deltaY is negative if the mouse wheel rotates away from the user. It's positive if the mouse wheel rotates toward the user. event.deltaX is positive if the mouse wheel moves to the right. It's negative if the mouse wheel moves to the left.

Calling myElement.mouseWheel(false) disables the function.

예제

구문

mouseWheel(fxn)

매개변수

fxn
Function|Boolean:

function to call when the mouse wheel is scrolled over the element. false disables the function.

Notice any errors or typos? Please let us know. Please feel free to edit src/core/p5.Element.js and open a pull request!

관련 레퍼런스