šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

zoom-it

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zoom-it

Allows to pinch zoom, rotate, pan any HTML element.

1.0.7
latest
Source
npm
Version published
Weekly downloads
242
9.01%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Zoom it!

Allows your users to zoom, rotate, and pan images using touch gestures.

For a DEMO open this on mobile: http://anitasv.github.io/zoom/

TypeLinkSize
Minifiedhttp://anitasv.github.io/zoom/zoom-1.0.7.min.js2184 bytes (gzip: 1024 bytes)
Debugginghttp://anitasv.github.io/zoom/zoom-1.0.7.js10815 bytes
NPMhttps://www.npmjs.com/package/zoom-it

For an explanation of math see https://github.com/anitasv/zoom/wiki/Explaining-Math

Send pull requests, bug reports, and feature requests to https://github.com/anitasv/zoom/

Usage

<div width=320 height=240 style="overflow:hidden;">
    <!-- this doesn't have to be an image -->
    <img id="torotate" width=320 height=240 src="https://lh3.googleusercontent.com/w33i78Rt0j4GHr7SA1luYtBAtmC1DmRHwobUcK1wCKivA_u4VczsDw0CweLmJpUwFRUs=w1920-h1200-no">
</div>

<script type="text/javascript" src="http://anitasv.github.io/zoom/zoom-1.0.7.min.js"> </script>

The overflow:hidden is to crop the image moving outside the original border. Be creative. Hotlinking to github.io may get you blocked; so copy to your own location.

var elem = document.getElementById('torotate');
var zm = new Zoom(elem, {
    rotate: true
});

// after use, call to remove event listeners, etc:
zm.destroy()

Pan cannot be currently disabled, there is an outstanding issue on it.

You can do operations like zm.reset() on this object, by default it attaches listeners to the object given.

Optionally pass a window-like object as the third parameter (e.g. for testing, or use in a non-browser environment).

If you are using NPM, then

var zoom = require("zoom-it");

var elem = document.getElementById('torotate');
var zm = new zoom.Zoom(elem, {
    rotate: true
});

Keywords

zoom

FAQs

Package last updated on 18 Aug 2022

Did you know?

Socket

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.

Install

Related posts