mobile_img_pinch_to_zoom
v1.0.0
Published
Allows you to pinch and zoom an image inside a container on mobile devices.
Downloads
3
Readme
PinchToZoom
Allows you to pinch and zoom an image inside a container on mobile devices.
PinchToZoom v1.0.0
Install
Install with npm: npm install pinch_to_zoom
Install with Yarn: yarn add pinch_to_zoom
Usage
initialize PinchToZoom with Vanilla Js
const imgElement = document.getElementById("zoomable-image");
const pinchToZoomInstance = new PinchToZoom(imgElement);
Classes
.zoomed
added when the user pinch and zoomed the image (When scale is > 1).
Destroy
Unbind the scroll pinchToZoom touch events from the element.
pinchToZoomInstance.destroy();