PDA

View Full Version : Auto Sizing Popup Windows



Adam678
27-11-2005, 04:58 AM
Hello!

Is it possible to autoresize a popup window to match the dimensions of the content being displayed? On a website of mine I have a list of games, and when you click on a game I want a popup window to....well popup! But I want the window automatically be the same size as the content it is displaying (it will be displaying a .swf file). I have tried setting the width and height to 100% and that does not work, I have also tried setting W and H to "auto", that too does not work, is there like a JavaScript code that will do it?

BTW I have noticed that in Firefox if you don't set a H and W it automatically resizes to fit the content but in IE it does not.
Cheers!

:D

Renmoo
27-11-2005, 08:18 AM
Put this javascript code into your popup page:

<script>
function resizing() {
self.resizeTo(400,600)
}
</script>

Change the 400 and 600 to suit your webpage.

Cheers :)

Renmoo
27-11-2005, 08:45 AM
Sorry, and add this line as well to execute the function:

<script>resizing()</script>

Cheers :)

Adam678
28-11-2005, 02:02 AM
Thanks