一个用于放大缩小 DOM 元素的 Web 组件。使用方法 sh npm install --save-dev pinch-zoom-element html Hello! 现在,上述代码可以放大缩小…
一个用于放大缩小 DOM 元素的 Web 组件。使用方法 sh npm install --save-dev pinch-zoom-element html Hello! 现在,上述代码可以放大缩小…
A web component for pinch zooming DOM elements.
npm install --save-dev pinch-zoom-element
Hello!
Now the above can be pinch-zoomed!
Hello!
pinchZoom.x; // x offset
pinchZoom.y; // y offset
pinchZoom.scale; // scale
Set the transform. All values are optional.
pinchZoom.setTransform({
scale: 1,
x: 0,
y: 0,
// Fire a 'change' event if values are different to current values
allowChangeEvent: false,
});
Scale in/out of a particular point.
pinchZoom.scaleTo(scale, {
// Transform origin. Can be a number, or string percent, eg "50%"
originX: 0,
originY: 0,
// Should the transform origin be relative to the container, or content?
relativeTo: 'content',
// Fire a 'change' event if values are different to current values
allowChangeEvent: false,
});
Simple image pinch-zoom. Although you can put any element in ``.
lib/index.ts - Original TypeScript.dist/pinch-zoom.mjs - JS module. Default exports PinchZoom.dist/pinch-zoom.js - Plain JS. Exposes PinchZoom on the global.dist/pinch-zoom-min.js - Minified plain JS. 2.3k gzipped.暂无开放 Issues,或尚未同步最近议题。