A minimal Medium.com-style lightbox for enlarging media using css transforms, scaling images from their position on a page
$ npm install minimal-lightbox
There are two primary ways to consume this library:
- data-attributes on elements: they must be present when this library is loaded as it attempts to bind to all elements with
- It also exposes an interface to programmatically bind to elements:
;// pass any selector/element node to the default import;;
Usage as an external script tag
When including this library as an external script tag (instead of with a module system like browserify or webpack) it exposes a global
minimalLightbox as the main export. You can use that to programmatically bind elements to be zoomable.
This module is dependent on classes/styles to produce the lightbox effect, so your mileage may vary on certain older browsers.
You'll want to include the styles from the
/dist directory as well.
<!-- include the package -->
Fork and PR any improvements, bug fixes you find. Feel free to open new issues.
To compile new files in
/dist that include your changes, use this:
$ npm run build