stencil-img-zoom
v0.0.1
Published
Web component for zoomable images
Downloads
406
Readme
img-zoom
What is it?
img-zoom
is a web component that handles mouse zoom / drag for HTML images.
Like no other, it does not resort to using CSS background images, or a canvas, but works directly with the img
tag.
Usage
To use this component in your app, no matter what framework you are using, follow these steps:
- pop this script tag
<script async defer src='https://unpkg.com/[email protected]/dist/img-zoom.js'></script>
into your index.html
API
Properties:
- src (string): the path or url to the image you want to load
- alt (string): the value you want to use for the alt property of the image https://www.w3schools.com/tags/att_img_alt.asp
Examples
<img-zoom src="assets/img.jpg" alt="Tiger"/>