Some time ago with help from this forum I developed a slideshow for my website which works exactly as intended in IE. However I recently discovered it doesn’t work in Firefox. It appears the chgImg and auto commands are not defined in Firefox. Are there equivalents that do work so that I can simply replace one with the other? Or do I need to start again?
Not sure if we are allowed to include links to the page in question but if we are here it is:-
[url]http://www.robsphotographyservices.com/GalleryChurches.htm
Here is the head code below:-
<!– Begin
var NewImg = [
“images classic framed/St-Basil’s-Cathedral,-Red-Square-2.jpg”,
“images classic framed/Basilica-of-Sacre-Coeur,-Montmartre.jpg”,
“images classic framed/Alexander-Nevsky-Cathedral,-Tallinn-2.jpg”,
];
var NewImgWidth = [“295″,”295″,”600”];// added for width control
var ImgNum = 0;
var ImgLength = NewImg.length – 1;
//Time delay between Slides in milliseconds
var delay = 5000;
var lock = false;
var run = setInterval(“chgImg(1)”, delay);
var lock = true;
function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
document.slideshow.width = NewImgWidth[ImgNum]; }// added for width control
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval(“chgImg(1)”, delay);
}
}
function preloadImages()
{
var imageArr=[];
for (var i=0; i<NewImg.length; i+=1)
{
imageArr[i]=new Image(NewImgWidth[i]);
imageArr[i].src=NewImg[i];
}
}
window.onload=preloadImages;
End –>
and in the body code:-
<td>
<font face=”Verdana” size=”2″ style=”text-align: center” color=”#FFFFFF”>Slideshow - </font>
<a href=”javascript:chgImg(-1)” style=”text-decoration: none”>
<font color=”#000000″ size=”2″>Previous </font></a>
<a href=”javascript:auto()” style=”text-decoration: none”>
<font color=”#FFFFFF” size=”2″>Start/Stop </font></a>
<a href=”javascript:chgImg(1)” style=”text-decoration: none”>
<font size=”2″ face=”Verdana” color=”#000000″>Next</font></a>
<p style=”text-align: center”>
<img border=”0″ src=”images%20classic%20framed/St-Basil’s-Cathedral,-Red-Square-2.jpg” name=”slideshow” width=”295″ height=”436″>
<td valign=”top” width=”175″ style=”line-height: 150%; margin-bottom: 0″>