pinch-to-zoom
Instagram like Pinch-to-zoom.
DEMO Pinch on multitouch devices on images.
No dependencies.
Usage
interface PinchToZoomConfig maxScale: number; minScale: number; transitionDuration: number; onScale?: any; element: HTMLElement options?: PinchToZoomConfig;
Default Options
maxScale: 4
minScale: 1
transitionDuration: 100
React Usage
;; Component imgRef = React; pinchToZoom = null; { if thisimgRefcurrent thispinchToZoom = thisimgRefcurrent; } // Don't forget to unsubscribe before unmounting { if thispinchToZoom thispinchToZoom; } { return <img ref=imgRef /> ; }
## React functional Usage
;; const PinchToZoomImage = { const imgRef = const pinchToZoom = return <img ref=imgRef ...props />}