@@ -195,11 +195,17 @@ p5.Element.prototype.mousePressed = function (fxn) {
195
195
/**
196
196
* The .mouseWheel() function is called once after every time a
197
197
* mouse wheel is scrolled over the element. This can be used to
198
- * attach element specific event listeners.<br><br>
199
- * The event.wheelDelta or event.detail property returns negative values if
200
- * the mouse wheel if rotated up or away from the user and positive in the
201
- * other direction. On OS X with "natural" scrolling enabled, the values are
202
- * opposite.
198
+ * attach element specific event listeners.
199
+ * <br><br>
200
+ * The function accepts a callback function as argument which will be executed
201
+ * when the `wheel` event is triggered on the element, the callabck function is
202
+ * passed one argument `event`. The `event.deltaY` property returns negative
203
+ * values if the mouse wheel is rotated up or away from the user and positive
204
+ * in the other direction. The `event.deltaX` does the same as `event.deltaY`
205
+ * except it reads the horizontal wheel scroll of the mouse wheel.
206
+ * <br><br>
207
+ * On OS X with "natural" scrolling enabled, the `event.deltaY` values are
208
+ * reversed.
203
209
*
204
210
* @method mouseWheel
205
211
* @param {Function } fxn function to be fired when mouse wheel is
@@ -231,8 +237,8 @@ p5.Element.prototype.mousePressed = function (fxn) {
231
237
*
232
238
* // this function fires with mousewheel movement
233
239
* // over canvas only
234
- * function changeSize() {
235
- * if (event.wheelDelta > 0) {
240
+ * function changeSize(event ) {
241
+ * if (event.deltaY > 0) {
236
242
* d = d + 10;
237
243
* } else {
238
244
* d = d - 10;
0 commit comments