
The updated version of the script is available here.
This extremely lightweight JavaScript image gallery and slideshow script clocks in under 3kb packed and includes a number of cool features. Recently I was looking for a nice existing script for a client project. I wanted something elegant, simple and lightweight. What I found were a number of scripts built on JavaScript frameworks and a few others that really lacked any appealing interface or were over 30kb. I challenged myself to build a full-featured slideshow gallery under 4kb. Hopefully I will be add a few more features to the script soon and make it a little mode user-friendly.
Here is an example of the markup…
<div id="gallery"> <div id="imagearea"> <div id="image"> <a href="javascript:slideShow.nav(-1)" id="previmg"></a> <a href="javascript:slideShow.nav(1)" id="nextimg"></a> </div> </div> <div id="thumbwrapper"> <div id="thumbarea"> <ul id="thumbs"> <li value="1"><img src="thumbs/1.jpg" alt="" /></li> <li value="2"><img src="thumbs/2.jpg" alt="" /></li> <li value="3"><img src="thumbs/3.jpg" alt="" /></li> <li value="4"><img src="thumbs/4.jpg" alt="" /></li> <li value="5"><img src="thumbs/5.jpg" alt="" /></li> </ul> </div> </div> </div>
The list section is the important element to the gallery. Each li has a value property that is set to the name of the full-size image. The interface is very flexible and can easily be altered in the HTML and CSS.
You will also need to setup the variables below and include the slideshow JavaScript…
var imgid = 'image'; // id of image div // var imgdir = 'fullsize'; // full-size image directory // var imgext = '.jpg'; // full-size image extension // var thumbid = 'thumbs'; // id of the thumbnail container // var auto = true; // automatic rotation toggle // var autodelay = 5; // seconds before the image rotates //
This script isn’t completely polished yet but I wanted to go ahead and get it out there for anyone that can put it to use. It has been tested in all major browsers and is available free of charge for both personal or commercial projects under the creative commons license. Community support is available here. Paid support is also available, contact me for details.
Click here to download the source.
Update 5/16/2008 – Updated CSS and added outline:none for the next and previous links.
Update 5/26/2008 – Updated the CSS to resolve an issue with resizing the window in IE6. Thanks to Jon Stoski for reporting.
Update 5/28/2008 – Pushed script inside global namespace. Fixed a couple IE related bugs.

Pingback: Dynamic Image Gallery e Slideshow di immagini : sastgroup.com
Pingback: links for 2008-05-17 | JeremiahTolbert.com
Pingback: links for 2008-05-17 « toonz
Pingback: Freak-Log™ #12 — Freak Group
Pingback: Visual-Blast Media
Pingback: Daily Blog Post 05/20/2008 « Murratore’s Weblog
Pingback: Galería de imágenes ultraliviana — Tablosign
Pingback: Una completa galería de imágenes javascript en tan solo 8KB | Adictos a la red
Pingback: Dynamic image gallery and slideshow | Fluid Web - webdesign blog
Pingback: OneDesign| Dynamic Image Slideshow
Pingback: F-LOG-GE » Blog Archive » Lightbox-Matrix
Pingback: Bildergallerie Slideshow mit Ajax und Javascript for free » » pixey.de
Pingback: Discover The Best Of The Web In May 2008 - Opensource, Free and Useful Online Resources for Designers and Developers
Pingback: JavaScript sin frameworks / acualicio.us
Pingback: Best Design Articles from May 2008
Pingback: Kleine JavaScript Bildergalerie - Gery’s Blog
Pingback: Ajax ile resim galerileri ve slide show oluşturun : Sinan Elver | Blog
Pingback: DON’T MEASURE: The Best Design Articles from May 2008 | Dalton Trent's Blog
Pingback: 100 Scripts and Script Resources | OpenJason
Pingback: Focusing on Javascript (#3 of 3) « DGS about JAVA, Javascript
Pingback: Focusing on Javascript (#3 of 3) « AjAX and JavaScript
Pingback: Garuna Web Designer » Blog Archive » Dynamic Image Gallery and Slideshow
Pingback: Javascript image gallery roundup | Mike Meisner
Pingback: Most Wanted Ajax Techniques: 50+ Ajax Examples and Tutorials | Noupe
Pingback: Most Wanted Ajax Techniques: 50+ Ajax Examples and Tutorials | SulVision
Pingback: Ajaxian » Groups of 50+ Ajax Examples
Pingback: Most Wanted Ajax Techniques « Program2.0
Pingback: +50 Ejemplos en Ajax | ProyectoAurora.com
Pingback: Most Wanted Ajax Techniques: 50+ Examples and Tutorials | SulVision