Dynamic Image Gallery and Slideshow
This extremely lightweight JavaScript image gallery and slideshow script clocks in under 3kb packed and includes a number of cool features.
Here is an example of the markup…
<div id="gallery"> <div id="imagearea"> <div id="image"> <a href="[removed]slideShow.nav(-1)" id="previmg"></a> <a href="[removed]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 //
You might also like
Tags
accordion accordion menu animation navigation animation navigation menu carousel checkbox inputs css3 css3 menu css3 navigation date picker dialog drag drop drop down menu drop down navigation menu elastic navigation form form validation gallery glide navigation horizontal navigation menu hover effect image gallery image hover image lightbox image scroller image slideshow multi-level navigation menus rating select dependent select list slide image slider menu stylish form table tabs text effect text scroller tooltips tree menu vertical navigation menu