AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Code Generators - Window Generator

Window Generators

Creating exact size pop-up windows easily has always been sort of a hit and miss affair. Surprisingly the problem isn't Netscape's fault this time. Internet Explorer has always had problems with specified window sizes if certain window properties were turned off.

For example : if you wanted a window to open at 640x480 with all the properties on except for the address bar then the window opens approx 120 pixels higher than what we wanted.

If you don't believe me then set the Address Bar option to No - leave the rest as Yes then click here, the window that opens is approx 640x600 not ideal.

Using the code generator here you can create windows with whatever properties you like and the will open at the specified size.

If you clicked on the test link above then close the window that was opened. Leaving the Address Bar option at No, click here, now we get the window at the size we wanted :)

Needing more options when opening windows then get our advanced script

Set size and url

Width : : Height :
Window Properties

Address Bar
Status Bar
Menu Bar
Allow Resize
Copy History
Screen Position
Screen Position

small windows taskbar

Your code will appear below

Place the generated script code between the <head></head> tags.

Open the window from onload with 
<body onload="open_win('');"> 
with an onClick 
<a href="#" onClick="open_win('');return false;">Open the Window</a>

open_win('') opens the default url specified in the code generator. Alternatively, you can specify a url so the same window can be reused using open_win('http://THE_URL')

The generated code has been tested and found to work on IE6, Netscape 4.5, Netscape 6, Mozilla 1 - Due the way Opera 6 can be set up all windows will open at position 0,0.

Why not check out how your site looks in different browser sizes with our window test

Got any comments? Why not share them in our forum?

This tool is provided free of charge. Use of the generated code requires no obligation on your part to link to this site either by choice or by forcing a visible link to appear in the generated code.

No link to this site will appear on any pages that use code generated from this site. However, the generated code does produce a comment specifying the url of the code generator ( it is hidden and will never appear to your visitor ). You are free to remove the line but we would appreciate it if you left it in place. Thanks :)


[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]