Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 626 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 626 Bytes

lightweight-zoomer

Lightweight image zoomer on Vanilia JS without dependences, adaptive for touch devices

How to use

HTML template (It is neccessary to wrap img in container with class "light-zoom"):

<div class="light-zoom light-zoom-js">
    <img src="img/galaxy-space-stars-universe-nebula-4k-qw-2560x1600.jpg" alt="Demo image">
</div>

Just import css/zoom.css and js/zoom.js. Then init zoomer by zoomImage function

import zoomImage from './zoom.js';

let zoomBlock = document.querySelector('.light-zoom-js');
zoomImage(zoomBlock);

Demo

Watch demo