Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resize popup

Status
Not open for further replies.

nicsin

Programmer
Jul 31, 2003
743
GB
Hello,

my code (written in c#) opens a page in a popup. this page contains nothing but an iframe, which in turn contains a page. I am trying to resize the popup from a javascript on this latter page, on hitting a button for example. I have used

self.resizeTo
and
parent.window.resizeTo

but they don't work. Am I missing somthing here?

Thanks a lot
nicsin
 
this is my image popup page, its written in PHP tho but you can get the javascript code from it.

Code:
<html>
<head>
<?
$i	= 	$_GET['i'];
$t	= 	$_GET['t'];

$inf	= getimagesize ( $i.'.jpg' );
$width	= $inf[0];
$height	= $inf[1];
?> 

<title><?=$t?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="window.resizeTo(<?=$width+10?>,<?=$height+36?>); window.moveTo(((window.screen.width - <?=$width?>)/ 2),((window.screen.height - <?=$height?>)/2)); window.focus();">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="middle"> 
	  	<img src="<?=$i?>.jpg" alt="" name="image" width="<?=$width?>" height="<?=$height?>" id="image" /> 
  </td>
  </tr>
</table>   
</body>
</html>

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
thanks for your answer k9logic.

the code works if the page is opened using

window.open()

but it is actually opened through

ShowModalDialog()

and the resizeTo() doesn't seem to do anything.

Any ideas?
 
im not sure how ShowModalDialog() works, no experience in c...

have you tried (if possible) naming the window from c?

then windowName.resizeTo() might work?



I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top