Auto resize popup slideshow window by image size

admin

Administrator
Staff member
Hi All,

I'm trying to get a popup window for a slideshow to resize itself to the size of the next picture in the gallery. My pics are horizontal and vertical, mostly 600 x 400 or 400 x 600. The code I'm using now is functional, it opens a slideshow that users can click through but the size is static for either horizontal shots or vertical shots but doesn't go back and forth like I need it to.

So here's the code for launching the window:

<script language="JavaScript">
function ShowLarge(sUrl)
{
large_image_win = window.open('' + sUrl,'large_image_win','width=400,height=600,scrollbars=no,resizable=no,status=no,location=no,menuba r=no');
large_image_win.focus();
}
</script>

That sets the size of the window and can easily be changed to accomodate horizontal or vertical photos but can only be one or the other. Here's the actual link from later in the content section of my html file:

<A HREF=http://www.webdeveloper.com/forum/archive/index.php/"javascript:ShowLarge('001.html');"><IMG SRC='http://www.webdeveloper.com/forum/archive/index.php/../thumbs/001_1A.jpg'></A>

You'll notice the reference to 001.html. I have an *.html file for each photo in the gallery. Each one links forwards and backwards to the next and previous picture for my <<Back and Next>> links in the popup. Here's the key 001.html code:


<map name="header">
<area shape="rect" coords="270,13,311,25" href=http://www.webdeveloper.com/forum/archive/index.php/"012.html">
<area shape="rect" coords="335,13,375,25" href="002.html">
</map>

<body marginheight="0" marginwidth="0" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">

<table cellspacing="0" cellpadding="0" border="0" width="400">
<tr>
<td><img src="header.gif" usemap="#header" width="400" height="40" border="0" alt=""></td>
</tr>
<tr>
<td><img src="../001_1A.jpg" height="600" width="400" border="0" alt=""></td>
</tr>
</table>

Any ideas on how to make the popup window "read" the size of the next photo and automatically adjust its size to fit the next picture? I've considered adding something like a opener.close(); somewhere in there to close the popup in between differently sized photos but maybe there's a better way?

Please let me know if you have any ideas at all.

Thank you for your support,

Steve
 
Back
Top