Dynamic Image Gallery and Slideshow

Ajax Image Gallery
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…
01<div id="gallery">
02<div id="imagearea">
03<div id="image">
04<a href="javascript:slideShow.nav(-1)" id="previmg"></a>
05<a href="javascript:slideShow.nav(1)" id="nextimg"></a>
06</div>
07</div>
08<div id="thumbwrapper">
09<div id="thumbarea">
10<ul id="thumbs">
11<li value="1"><img src="thumbs/1.jpg" alt="" /></li>
12<li value="2"><img src="thumbs/2.jpg" alt="" /></li>
13<li value="3"><img src="thumbs/3.jpg" alt="" /></li>
14<li value="4"><img src="thumbs/4.jpg" alt="" /></li>
15<li value="5"><img src="thumbs/5.jpg" alt="" /></li>
16</ul>
17</div>
18</div>
19</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…
1var imgid = 'image'// id of image div //
2var imgdir = 'fullsize'// full-size image directory //
3var imgext = '.jpg'// full-size image extension //
4var thumbid = 'thumbs'// id of the thumbnail container //
5var auto = true// automatic rotation toggle //
6var 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.