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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Size windows? 1

Status
Not open for further replies.

un1k

Technical User
Mar 8, 2004
30
0
0
CA
Hi I am wondering how to automatically size a window on the load. For example I want my first page (index.htm) loads at 640x480. Is there a way to do this in HTML? If no, in JavaScript? thanks!
 
this will open a window with no controls and close itself. Not sure if this is what you want. Only works in IE
Code:
<html>
<head>
<title> Bad News
</title>
<script>
function bye() {
  self.opener=this;
  self.close();
}
</script>
</head>
<body  onLoad="window.open('[URL unfurl="true"]http://www.YourSite.com/MakeEmMad.htm',[/URL] 'NewWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,fullscreen=yes'),bye()">

</body>
</html>
I agree with the general consensus of this post BTW, I wouldn't use this!!!

Glen
 
ok - i figured it out - this script works just fine without having to write anything in the <HEAD> portion of my html page:
Code:
<script language="javascript">
var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=350,width=550');
	if (window.focus) {newwindow.focus()}
}
</script>

<a href="javascript:poptastic('[URL unfurl="true"]http://www.westwayelectricsupplyonline.com/shop/W004246desc.html');">Pop[/URL] it</a>

John Kolker
Programmer
jwkolker@comcast.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top