Panning and zooming events for any target. May come handy for webgl, canvas, svg, images or pure html manipulations. Handles mobile pinch-zoom, drag and scroll interactions, provides inertial movement.
const panzoom = ;let unpanzoom =;// call to remove panzoom handler from the target
test.js for basic use-case.
- @soulfresh/pan-zoom − compatible fork with elaborate API and fixes.
This package puts together high-quality tiny components, so acknowledgment to their authors:
- impetus by Chris Bateman @chrisbateman handles inertial drag.
- mouse-wheel by Mikola Lysenko @mikolalysenko covers cross-browser wheel event.
- touch-pinch by Matt DesLauriers @mattdesl handles mobile pinch gestures.
- touch-position by Matt DesLauriers @mattdesl tracks mouse and touch coordinates.
© 2017 Dmitry Yv. MIT License