[Javascript] create <div> using JS

aw alfwro at wp.pl
Wed Dec 11 14:53:25 CST 2002


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



More information about the Javascript mailing list