Hi Guys,
I need the following code to allow all common image formats, not just .jpgs, as I now need to display animated .gif images, as well as .jpgs.
How could this be done?
Many thanks,
Dave
ps: the code below uses a loop to count through the 7 images, replacing the ends of the filenames "_1.jpg", "_2.jpg", etc, as each image on the system has been suffixed with this format. I am happy to lose the loop if need be, and just have 7 different functions set up, if that makes it any easier.
how_many_thumbnails=7
var id="ctl00_ctl00_mainslot_partmedia_nppmblock_imgPart";
var name=document.getElementById(id).src;
for (i=1;i <= how_many_thumbnails;i++) {
newsrc=name.replace(/_1.jpg/i, "_"+i+".jpg");
document.getElementById("tn"+i).src=newsrc;
}
function showpic(number) {
document.getElementById(id).src=name.replace(/_1.jpg/i, "_"+number+".jpg");
thePath=document.getElementById(id).src;
}