I am new to Javascript and internet programming in general. I am trying to place a table on a web page and load, dynamically, a bunch of pictures into this table. The pictures already reside on my web server. I'm just not sure what the code is for doing such a thing. Anyone have any ideas or code examples.
Actually what I am trying to do is load about 150 images (thumbnails if possible) from the server onto a table on a single page. Then allow the users to put the mouse on each image and have the image blow up to it's normal size. Is there any kind of loop construct that will accomodate this?
Last edited by BlakeMckenna; 08-30-2004 at 05:44 PM.
Well it won't save you that much work to load the images dynamically. You'd have to code them into an array, then use createNode statements for the table, tr, and td and img tags. You'd also have to generate the whole page dynamically, which means the javascript function that would make the images large size, would have to be output by the 1st JS. Doesn't make sense.
It would be more complex than just coding the HTML doc, and putting the mouseover script in the header of the page.
But you'll find other problems. When you enlarge the thumbnails, it's gonna push around everything else on the page.
If you really wanna do it dynamically, I recommend serverside scripting, PHP or ASP or some other.
No, not offhand. But your server has to support ASP. Better check that out before choosing a language. But like I said, you're going to run into other problems. When you make the pic large, it'll push everything else out of position on the page. It'll be an ugly effect in general. Have you seen pages that use a thinner left frame for the thumbnails that scrolls, and a larger other frame for the large pic to display?
I thought of a way it wouldn't mess up your page. You could set the z-index to 2, or whatever so it will be in FRONT of the rest of the page. Shouldn't affect anything's placement then. It would just float above it.
Bookmarks