A lightweight, plug'n'play lightbox plugin for the web, written in about 100 lines of pure vanilla JavaScript.
Minifies to about 1.5 KB, gzip
s to about 750 B.
Comes with an optional default stylesheet mimicking Wikipedia's lightbox.
Check out the demo/documentation! It's mobile friendly as well :)
It's a lightbox plugin for the web – when you click a thumbnail, it'll open a fullscreen modal displaying a higher resolution version of it, like this:
Main page | Lightbox open |
---|---|
I needed a small and lightweight lightbox that mimicked Wikipedia's to use in a personal project of mine. I figured it'd be easier to write my own than to figure out what's the best alternative out there that was customizable enough for my needs.
- Very lightweight;
- Very simple to use;
- Progressive enhancement – browsers with no support will just have a regular
<a>
linking to the full-res image;
- Figure out browser compatibility (probably nothing incredible, I'll be honest)
- Figure out if it's acceptably accessible (it probably is! I think)
No, thanks! This is mostly a personal project, fit to my (very) specific needs. If you'd like to add, remove, or change anything, feel free to fork this and build your own personalized version! :)