[Javascript] create <div> using JS

charlie_chan charlie_chan at cox-internet.com
Thu Dec 12 00:42:27 CST 2002


I believe that creating an array of images to use as a image cache during
the download process is your best option.  You can then dynamically create a
page and use a variable that corresponds to the image in the cache for the
image to display on the page.  You can use a Boolean variable at some
point/s in the array that relates to a particular image location to
determine if a certain amount of images have been download.  That way you
will not have an active page without all the images you need to make it
work.

----- Original Message -----
From: "aw" <alfwro at wp.pl>
To: <javascript at LaTech.edu>
Sent: Wednesday, December 11, 2002 2:53 PM
Subject: [Javascript] create <div> using JS


> Hi
> I have galery page with smal pics, when you click them new window is
> opening with the picture orginal size.
> I'd like rebuit it that no new window is opening but new <div> section is
> creating and displaying the image with is orginal resolution within the
> confines of the old page.
>
> <DIV ID="imageName" STYLE="position: absolute; top: 10px; left 10px;
width:
> ImageWidthPx; height: ImageHeightPx; clip: rect(parameters); z-index: 20;
> visibility: visible;">
> <img src="someImage.jpg">
> </DIV>
>
> I could create definitions as shown above for each image with visibility
set: hide
> and on click change to visible but for large colection (about 100-200
images) it is
> no sens.
>
> How to rebuild this function that it won't open new window but create new
<div>
> section:
>
> <html>
> <head>
> .....
> ......
> .....
> function displayWindow(imageName, ImageWidthPx, ImageHeightPx) {
>         var Win = window.open(imageName,"displayWindow",'width='
> +ImageWidthPx+ ',height=' + ImageHeightPx + ');
> }
> ....
> ....
> </head>
> <body>
> ...
> ...
> <A HREF="javascript:displayWindow('Image01.jpg',500,500)">
>             <IMG SRC="Image01.jpg" ALT="" BORDER="2" HEIGHT="80"
> WIDTH="80">
>          </A>
> ...
> ...
> ...
> </body></html>
>
> Have any ideas?
>
> Regards
> andrzej
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list