[Javascript] Re: Getting image size and controlling window

Cutter (javascript list) javascript at theblades-family.com
Wed Oct 2 08:14:26 CDT 2002


You may have to adjust this script a little to fit your needs. I the 
original implementation you will see in document.write statement that we 
used the window.name property to complete the image name. The calling 
window.open statement passes the window.name to the new page as the second 
argument of the function. My implementation was writing this window.open 
statement dynamically using ColdFusion and SQL. You don't have to use this 
scenario to make the below page work. It looks like you just need to remove 
the reference to "+ window.name +". 

Cutter 

Jefferis Peterson writes: 

> This isn't quite working because I think my image is a variable. Shouldn't
> the doc write be in the header?: 
> 
> 
>> <TITLE>Large View of <?php echo $img; ?></TITLE>
>  ></HEAD>
>> <BODY 
>> onLoad="self.resizeTo(document.imgItemPic.width,document.imgItemPic.height+2
>> 5)" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0"
>> bgcolor="black" text="#FFFFFF">
>> <script language="JavaScript" type="text/JavaScript">
>> document.write("<IMG src='/<?php echo $img; ?>'>" + window.name + ".lg.jpg'
>> border='0' 
>> name='imgItemPic'>");
>> </script>
>> <DIV align="center">
>> <IMG src="/<?php echo $img; ?>"><br>
>> On 10/1/02 3:14 PM, "Cutter (javascript list)"
>> <javascript at theblades-family.com> wrote:
> 
> YOUR CODE WAS:
>> <!--- pic.html //--->
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
>> 
>> <html>
>> <head>
>> <title>Your Title</title> 
>> 
>> </head>  
>> 
>> <body 
>> onLoad="self.resizeTo(document.imgItemPic.width,document.imgItemPic.height+2
>> 5)" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
>> <script>
>> document.write("<img src='images/" + window.name + ".lg.jpg' border='0'
>> name='imgItemPic'>");
>> </script>
>> </html>
>> <!--- end //--->  
>> 
>> Pay attention to the onload event
> 
> ~~~~~~~~~~~~
> Jefferis Peterson, Pres.
> Web Design and Marketing
> http://www.PetersonSales.net
> Tel . 724-458-7169
> ICQ 19112253 
> 
> http://www.Slippery-Rock.com - 7,000 hits per year 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
 



More information about the Javascript mailing list