<< .. Go to : : Exercise 9 : Demo 9 : Rollovers : PopUp Window : DropDown Menu : Slideshow1 : Slideshow2 : More JavaScript : : All Class Demos .. >>

Popup Window

Try these links and see what happens:
click me for one
click me for two
click me for three

This code which will open up a new popup window. You can specify exactly where, how big, plus you can control the other attributes in this script, such as whether or not there is a toolbar or status bar in the window, by setting them to 1 (or yes) or 0 (or no). Change the size and location of the window by changing the code in red. To install this script, follow these simple steps:

1. Cut and paste this script into the HEAD of your document:


<script language="JavaScript">

<!--//BEGIN Script

function new_window(url) {

link = window.open(url,"LinkName","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=200,height=250,left=80,top=180");

}
//END Script-->

</script>

2. Cut and paste this into the BODY of your document:

Change the name in red to the name of the document you want to open in the popup window:

<a href="javascript:new_window('your_popup.html')">click me</a>