Medium Zoom Element
HTML Element for medium-zoom
Web component bundling the
medium-zoom
API.
Usage
npm install --save medium-zoom# or yarn add medium-zoom
From a CDN:
Use the medium-zoom
web component in your HTML page:
API
Options
Attribute | Description |
---|---|
src |
Source of the image |
alt |
Alternative text for the image |
width |
Width of the image |
height |
Height of the image |
margin |
Space outside the zoomed image |
background |
Color of the overlay |
scroll-offset |
Number of pixels to scroll to dismiss the zoom |
disable-metaclick |
Disables the action on meta click (opens the link / image source) |
zoom-target |
Source of the zoomed image |
Refer to medium-zoom
's options for default values.
Methods
Refer to medium-zoom
's methods.
JavaScript getters/setters
margin
background
scrollOffset
metaClick
zoomTarget
const image = document imagemargin = 48console // 48
Dev
- Run
yarn
to install Node dependencies - Run
yarn dev
to watch changes and rebuild the library - Open
examples/index.html
to check your changes (it includesdist/medium-zoom-element.min.js
which is watched withyarn dev
)
License
MIT © François Chalifour