Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] create <div> using JS


  • From: javascript@xxxxxxxxxx (aw)
  • Subject: [Javascript] create <div> using JS
  • Date: Wed, 11 Dec 2002 21:53:25 +0100

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