A simple, unobtrusive lightbox engine written in Javascript without any additional libraries, css or images required.
kzimmermann 9d3e26a61b Migrated from Google Code | 9 år sedan | |
---|---|---|
LICENSE | 9 år sedan | |
README.md | 9 år sedan | |
example.html | 9 år sedan | |
simplelightbox.js | 9 år sedan |
simplelightbox is a simple unobtrusive lightbox engine written in javascript without any additional libraries, css or images required.
http://dl.dropboxusercontent.com/u/19410754/javascript/promo.png
The goal of this project is to create a powerful way to highlight and display images on a webpage without having to resort to bloated javascript libraries or complex setup methods - everything simplelightbox needs is a browser with javascript and a few images to work!
To use simplelightbox, add it in a <script>
element, such as <script src="simplelightbox.js"></script>
, and initialize it with the command slbInitialize()
. simplelightbox will automatically find all images in the page and add functionality to them. To trigger simplelightbox, simply click an image.
If you do not wish to apply the simplelightbox functionality to every image in your page, add the slbPhoto
class to the desired images. simplelightbox will then only make the images tagged with this class functional.
If you would like to add a legend to a picture, include it in your markup as the alt
attribute. This is not only a recommendation from the W3C, but also aids accessibility and helps your site's SEO ;)
Here's an [http://dl.dropboxusercontent.com/u/19410754/javascript/example.html example page] using simplelightbox to enhance viewing in a light, unobtrusive way.
Enjoy!