Zooming
Image zooming with pure JavaScript. No extra dependency. It supports zooming with a higher resolution image if supplied.
Install
npm install zooming --save
Usage
- Include
zooming.js
in your page:
<script src="dist/zooming.js"></script>
- Add
data-action="zoom"
attribute to an image to make it zoomable:
<img src="img/sample.jpg" data-action="zoom" />
- Add
data-original
attribute to supply a higher resolution image when zooming in:
<img src="img/thumbnail.jpg" data-action="zoom" data-original="img/original.jpg" />
Credit
Inspired by zoom.js.