Skip to content

Lightweight image zoomer on Vanilia JS without dependencies

Notifications You must be signed in to change notification settings

dimanzver/lightweight-zoomer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Lightweight image zoomer on Vanilia JS without dependencies

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published