#cy.wheelBehavior()
// What a wheel over the canvas does: 'zoom' (the default) zooms about the cursor; 'pan' pans by the wheel's delta and emits scrollpan, while a ctrl- or meta-wheel — the encoding a trackpad pinch arrives in — still zooms; 'modifier-zoom' leaves the plain wheel to the page (it scrolls past the graph) and zooms only on a ctrl- or meta-wheel
cy.wheelBehavior(): WheelBehaviorWhat a wheel over the canvas does: 'zoom' (the default) zooms about the cursor; 'pan' pans by the wheel's delta and emits a scrollpan event, while a ctrl- or meta-wheel — the encoding a trackpad pinch arrives in — still zooms; 'modifier-zoom' leaves the plain wheel to the page (it scrolls past the graph) and zooms only on a ctrl- or meta-wheel. Every mode honours the toggles (userZoomingEnabled gates a zoom, userPanningEnabled a pan), and a wheel the settings leave inert is not preventDefault()ed, so the page scrolls in every mode.
WheelBehaviorthe current wheelBehavior value
if mode is not 'zoom', 'pan' or 'modifier-zoom'
#cy.wheelBehavior(mode)
// What a wheel over the canvas does: 'zoom' (the default) zooms about the cursor; 'pan' pans by the wheel's delta and emits scrollpan, while a ctrl- or meta-wheel — the encoding a trackpad pinch arrives in — still zooms; 'modifier-zoom' leaves the plain wheel to the page (it scrolls past the graph) and zooms only on a ctrl- or meta-wheel
cy.wheelBehavior(mode: WheelBehavior): thisWhat a wheel over the canvas does: 'zoom' (the default) zooms about the cursor; 'pan' pans by the wheel's delta and emits a scrollpan event, while a ctrl- or meta-wheel — the encoding a trackpad pinch arrives in — still zooms; 'modifier-zoom' leaves the plain wheel to the page (it scrolls past the graph) and zooms only on a ctrl- or meta-wheel. Every mode honours the toggles (userZoomingEnabled gates a zoom, userPanningEnabled a pan), and a wheel the settings leave inert is not preventDefault()ed, so the page scrolls in every mode.
| Name | Description |
|---|---|
mode: WheelBehavior | the behaviour to set |
thisthis core, for chaining
Example
const result = cy.wheelBehavior("zoom");console.log(result === cy); // trueif mode is not 'zoom', 'pan' or 'modifier-zoom'