Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    odd HTML Generator.

    Soz don't know what to label this really, anyway I got this class function.

    Code:
    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?
    Last edited by Garadon; 02-06-2004 at 07:34 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •