I built a little javascript/TT image navigator that allows you to load images from a directory, display them as thumbnails and zoom them as you click on them. This is nice for doing things like selecting images for various web applications. It relies on some javascript, but to my knowledge it's totally cross browser compliant.
Here's the javascript you'll need:
[code]
// this is used to toggle a specific div's display status
function div_toggle (thisdiv) {
var the_div = document.getElementById( thisdiv );
if (the_div.style.display == 'block') {
the_div.style.display='none'; }
else { the_div.style.display='block';}
}
[/code]
Here's the TT code. The code assumes you have print size images in
[code]
[% USE dir = Directory('/var/www/eam/www/images/flyermaker') #name of the directory you're using -%]
[% thepath = "/images/flyermaker/" #path that you want images to use -%]
|
Choose Image:
[% FOREACH file = dir.files -%] [% IF ((loop.index mod 12 == 0) && (loop.index >= 1)) -%]
[% END -%]
[% IF loop.index mod 6 == 5 -%] [% END -%] [% IF (loop.index mod 12 == 11) -%]Images [% loop.index - 11 %] - [% loop.index + 1 %] [% IF loop.index > 12 %] < Previous | [% END %] Next > [% END %] [% IF loop.last %] < Previous[% END %] [% IF ((loop.last) || (loop.index mod 12 == 11) ) -%] [% END -%] |
Image Choice:![]() Click image to zoom |
[/code]
Fun! Here's an example of it's use, shamelessly stolen from the code I wrote for Jason for the forthcoming eggplant site.
Choose Image:
Image Choice:
![]()
Click image to zoom



