...

View Full Version : odd HTML Generator.



Garadon
02-06-2004, 08:31 PM
Soz don't know what to label this really, anyway I got this class function.



this.MakeGallery=function()
{
switch(this.setup)
{
case 1:
{
id=0;
document.writeln('<div style="position:relative;left:30px;width:500px;height:300px;background-color:#FF0000" id="gallery">');
for(I=0;I<=2;I++)
{
for(J=0;J<=5;J++)
{
document.writeln('<div style="position:absolute;top:'+(I*75+5)+'px;left:'+(J*60+5)+'px;width:55px;height:70px;border : 1px solid White;" id="'+id+'"></div>');
id++;
}
}
document.writeln('</div>');
I=0;
while(I<(6*3) && I<this.imageList.length)
{
var Div=document.getElementById(I);
Div.innerHTML='<img src="'+this.imageList[I][0]+'">';
I=I+1;
}
}
}
}


Anyway that don't work gives me a null object when I reach the while loop.
But when I put
document.write('ANYTHING')
in the outer for loop it does work, any suggestions as to why?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum