I come to this place again in need of help. I recently added some javascript to the website in order to add a basic changing image thingy. It all worked fine when i was coding it in notepad. However, when i copied the code through into sellerdeck it has stopped working.
The script has been placed within the <head> tag and the body part has been added to the fragment.
As soon as i put it into sellerdeck the javascript stops working. Any help would be much appreciated.
The script has been placed within the <head> tag and the body part has been added to the fragment.
Code:
<html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- var dimages=new Array(); var numImages=3; for (i=0; i<numImages; i++) { dimages[i]=new Image(); dimages[i].src="image"+(i+1)+".jpg"; } var curImage=-1; function swapPicture() { if (document.images) { var nextImage=curImage+1; if (nextImage>=numImages) nextImage=0; if (dimages[nextImage] && dimages[nextImage].complete) { var target=0; if (document.images.myImage) target=document.images.myImage; if (document.all && document.getElementById("myImage")) target=document.getElementById("myImage"); // make sure target is valid. It might not be valid // if the page has not finished loading if (target) { target.src=dimages[nextImage].src; curImage=nextImage; } setTimeout("swapPicture()", 5000); } else { setTimeout("swapPicture()", 500); } } } setTimeout("swapPicture()", 5000); //--> </SCRIPT> </head> <body onload="setupPicChange();"> <IMG WIDTH=250 HEIGHT=250 ID="myImage" NAME="myImage" SRC="images\image0.jpg"></IMG> </body> </html>
Comment