Pop-Up Windows

chinmay.sahoo

New member
Pop-up windows have a bad name. People associate them with pop-up ads that appear when pages of a site load, and they often feature advertisements or unwanted information. There are, however, some very legitimate uses for pop-up windows. For example, you might just want to keep users on the current page while allowing them to provide some other information in a pop-up, or you might want to open something from your site (such as an image) in a new window without the user losing his or her place.


Of course, you can create a normal link and make the page open in a new window by adding the target= ”_new” attribute, but when you create a pop-up in JavaScript you can control the dimensions of the window, indicate whether it can be resized or not, and whether it has scrollbars

Code:
<a
href=”http://google.com/”
onclick=”window.open(this.href, ‘search’,
‘width=400,height=300,scrollbars,resizable’);
return false;”
>
Click here for the link to open in a popup window.
</a>
 
A window that suddenly appears (pops up) when you select an option with a mouse or press a special function key. Usually, the pop-up window contains a menu of commands and stays on the screen only until you select one of the commands. It then disappears.
 
Back
Top