Advanced question???

wxdqz

New Member
Ok, I have a rotating images script and it works for all my pages in the root directory, but when I put one of my pages in another folder, the image rotation is disabled. Any ideas to how I can fix that? The script is listed below.. Lets say that the new folder is "email" for an example..

//<script language="JavaScript">
function LoadImg() {
var n=0;
var a=null;
var imgs = new Array();
/* enter list of image locations below */
var locs = ["img/r_img/img001", "img/r_img/img002", "img/r_img/img003", "img/r_img/img004", "img/r_img/img005", "img/r_img/img006", "img/r_img/img007", "img/r_img/img008", "img/r_img/img009", "img/r_img/img010"];

n = locs.length;
n = Math.floor(Math.random() * n);
document.img1.src=locs[n] + "_01.jpg";
//document.img2.src=locs[n] + "_02.jpg";
}
 
Back
Top