Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
When the @whell event is called, the WheelEvent event object is passed, it has a deltaY property, it just indicates where the mouse is spinning. If the number is positive, but the wheel is spinning down, if negative - up.
Example
there you can instead of assigning this.pos, put a call to your methods wheelUp, wheelDown.
UPD: to prevent the browser window from scrolling, you can add .prevent events to the definition
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question