# pinch **Repository Path**: mirrors_component/pinch ## Basic Information - **Project Name**: pinch - **Description**: pinch in and out on elements on handheld devices - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pinch pinch in and out on elements on handheld devices. ## Installation Install with [component(1)](http://component.io): $ component install component/pinch ## Example ```js pinch(img, function(e) { dot.style.left = e.x + 'px'; dot.style.top = e.y + 'px'; dot.style['-webkit-transform'] = 'scale(' + e.scale + ')'; }); ``` ## API ### Pinch(el, fn) Initialize `Pinch` with the element `el` and callback function `fn`. ```js pinch(img, function(e) { var midpoint = { x: e.x, y: e.y }; var scale = e.scale; }); ``` The event object `e` is augmented with following keys: - `x`: the x coordinate of the midpoint between your two fingers - `y`: the y coordinate of the midpoint between your two fingers - `scale`: the relative distance between your two fingers starting at 1. ### Pinch.unbind() Unbind ## TODO * add `e.rotate` support for android ## License MIT