chestertb
10-29-2003, 01:05 AM
Hi all,
My webpage uses little graphics images for buttons, and has the usual rollover effects and other eye candy.
To make the page work, I preload images and then re-assign images like this...
i34a=New Image;i34a.src="images\i34a.gif"
i35a=New Image;i35a.src="images\i35a.gif"
etc... and not... 34 and 35 do not signify that there have been 33 images before.
These images actually form a menu tree and it means that once everythings loaded and assigned, the page is lightning fast.
ITo assign, I have 6 images on the page, labeled btn1 through 6.
Swap images in and out as required by making one variable equal to another as follows;
img1=i34a; //which is assembled according to values returned in an onclick function
imgName = "btn" + y;
imgOn = eval("img"+y '.src');
dr(imgName,imgOn);
document[im].src = io
My webpage uses little graphics images for buttons, and has the usual rollover effects and other eye candy.
To make the page work, I preload images and then re-assign images like this...
i34a=New Image;i34a.src="images\i34a.gif"
i35a=New Image;i35a.src="images\i35a.gif"
etc... and not... 34 and 35 do not signify that there have been 33 images before.
These images actually form a menu tree and it means that once everythings loaded and assigned, the page is lightning fast.
ITo assign, I have 6 images on the page, labeled btn1 through 6.
Swap images in and out as required by making one variable equal to another as follows;
img1=i34a; //which is assembled according to values returned in an onclick function
imgName = "btn" + y;
imgOn = eval("img"+y '.src');
dr(imgName,imgOn);
document[im].src = io