|
|
|
|
|
function openWinBoo()
{
NewWindow=window.open('boo.html', 'boo',
'width=180,height=50');
}
This creates a new window called "boo", which displays the HTML page "boo.html", and is 180 pixels wide and 50 pixels high. The function openWinBoo() is called when you click on the link above. The code for the link looks like this: Click <a href="javascript:openWinBoo()">here</a> The javascript: bit tells the browser to call a JavaScript function - in this case, our openWinBoo() function.
Let's take a closer look at our function.
Each of these properties can have the value of yes (the feature will appear in the new window) or no (the new window will have that feature disabled). An important point to note about these properties is that they mustn't have spaces between them. For example, 'width=180,height=50' will work, but 'width=80, height=50' won't. For example, this function creates a new window with just the menu and the URL entry box: function openWinMenuUrl() |
|
|
{ Click here to see it in action. Now you know how to make a new window appear, and how to make that window look the way you want it. Try playing with different properties in the window.open method and enjoy the power of JavaScript! The End That's the end of this tutorial. We hope you found it useful. If you're still stuck and would like further help, check out our online www.elated.com/forums where you can get assistance from members of Elated and other webmasters. If you would like to offer us feedback on this or any of the tutorials, please visit our www.elated.com/forums. Have fun! <><><><><><> Matt Doyle works for ELATED.com, who produce a range of great Webmaster resources, including the commercial-quality Website templates available at www.pagekits.com/ Other
Resources for Pop-Up Windows
|
|
![]() |
|
|
|