FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Window resizing with javascript?

 


Satori
Is there a way for me to resize a window that the user opens to view a picture? I have thumbnails on my website and I want people to be able to click them and have a new window open with the larger image, but the window is automatically resized to fit the picture and some text.

Any help would be greatly appreciated!

Thanks
shamil
May be you don't specify height and width parameters on window.open. If this is the case put the whatever height and width u want like
Code:
window.open("Sample.htm",null,
    "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");

But if you want dynamically resize the window u can use window.resizeTo.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>RESIZE</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<script type="text/javascript">
    window.resizeTo(600,300);
</script>
</body>
</html>
Ranfaroth
Modern browsers have options to prevent webmasters to resize their windows...
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.