leechun
05-16-2003, 05:20 PM
hello people:
i have been trying to create layers(<div> tag) using for loop so that i can generate many of them and manipulate them as well. however, i have entountered some question. if i put a image in each layer like this:
document.write('<img id = "sec_img'+index+' ">');
or
document.write('<img id = "eval("sec_img" + index )" >');
where var index is the loop control.
doesn't this mean that i can then alter aspects of the imgs using soemthing like
sec_img0.width = somevalue
sec_img1.width = somevalue
.
.
.(eventually using a loop to alter them as well...)
if yes, i can't seems to get it to work. maybe its the syntax that i have got it wrong, can anyone help?
many thanks!!!!
CHUN
i have been trying to create layers(<div> tag) using for loop so that i can generate many of them and manipulate them as well. however, i have entountered some question. if i put a image in each layer like this:
document.write('<img id = "sec_img'+index+' ">');
or
document.write('<img id = "eval("sec_img" + index )" >');
where var index is the loop control.
doesn't this mean that i can then alter aspects of the imgs using soemthing like
sec_img0.width = somevalue
sec_img1.width = somevalue
.
.
.(eventually using a loop to alter them as well...)
if yes, i can't seems to get it to work. maybe its the syntax that i have got it wrong, can anyone help?
many thanks!!!!
CHUN