
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
pinch-zoom-js
Advanced tools
Browser library for multi-touch gestures to zoom and drag on any DOM element.
PinchZoom is a Javascript library providing multi-touch gestures for zooming and dragging on any DOM element.
let el = document.querySelector('#my-id');
let pz = new PinchZoom(el, options);
tapZoomFactor: Zoom factor that a double tap zooms to. (default 2)
zoomOutFactor: Resizes to original size when zoom factor is below this value. (default 1.3)
animationDuration: Animation duration in milliseconds. (default 300)
maxZoom: Maximum zoom factor. (default 4)
minZoom: Minimum zoom factor. (default 0.5)
draggableUnzoomed: Capture drag events even when the image isn't zoomed. (default true)
(using `false` allows other libs (e.g. swipe) to pick up drag events)
lockDragAxis: Lock panning of the element to a single axis. (default false)
setOffsetsOnce: Compute offsets (image position inside container) only once. (default false)
(using `true` maintains the offset on consecutive `load` and `resize`)
use2d: Fall back to 2D transforms when idle. (default true)
(a truthy value will still use 3D transforms during animation)
verticalPadding: Vertical padding to apply around the image. (default 0)
horizontalPadding: Horizontal padding to apply around the image. (default 0)
onZoomStart: Callback for zoomstart event (params: Pinchzoom object, Event event) (default null)
onZoomEnd: Callback for zoomend event (params: Pinchzoom object, Event event) (default null)
onZoomUpdate: Callback for zoomupdate event (params: Pinchzoom object, Event event) (default null)
onDragStart: Callback for dragstart event (params: Pinchzoom object, Event event) (default null)
onDragEnd: Callback for dragend event (params: Pinchzoom object, Event event) (default null)
onDragUpdate: Callback for dragupdate event (params: Pinchzoom object, Event event) (default null)
onDoubleTap: Callback for doubletap event (params: Pinchzoom object, Event event) (default null)
let pz = new PinchZoom(myElement);
pz.enable(); // Enables all gesture capturing (is enabled by default)
pz.disable(); // Disables all gesture capturing
pz.destroy(); // Unmounts the zooming container and global event listeners
var myElement = document.getElementById("myElement");
var pz = new PinchZoom.default(myElement, {
draggableUnzoomed: false,
minZoom: 1,
onZoomStart: function(object, event){
// Do something on zoom start
// You can use any Pinchzoom method by calling object.method()
},
onZoomEnd: function(object, event){
// Do something on zoom end
}
})
Events are deprecated in favour of callbacks (see above).
Pinchzoom emits custom events you can listen to:
pz_zoomstart Started to zoom
pz_zoomend Stopped zooming
pz_zoomupdate Zoom factor updated
pz_dragstart Started to drag the element
pz_dragend Stopped to drag the element
pz_dragupdate Drag position updated
pz_doubletap Resetting the zoom with double-tap
(if need be, the event names can be customized via options
)
git tag -m "v2.2.0" v2.2.0
npm whoami; npm publish
)git push origin v2.2.0
)Licensed under the MIT License.
FAQs
Browser library for multi-touch gestures to zoom and drag on any DOM element.
The npm package pinch-zoom-js receives a total of 7,687 weekly downloads. As such, pinch-zoom-js popularity was classified as popular.
We found that pinch-zoom-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.