Popups Tutorial

This tutorial is for HTML.

How to make popups like this one:

There are two different ways of doing this. I'll list both ways, and then list the uses for the specific atributes This is the first way:

You put this in your Head section - it tells you what page you want the popup to be, how big you want it, if you want scroll bars on it, etc...:

<SCRIPT LANGUAGE="JavaScript">
<!--

function popup() {
flyout=window.open("popup.html","popup","resizable=no,scrollbars=yes,
menubar=no,status=no,directories=no,width=600,height=400");
}

//-->
</SCRIPT>


When it comes to making the link for the popup, you use this:

<a href="javascript:popup()">Pop up!</a>

The other way is slightly more simple:

<a href="#" onClick="crush=window.open('popup.html','popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=300');return false;">Pop Up!</a>

These are the things you can change:

popup.html - change this to whatever page you want to pop up when you click the link.

toolbar - if you want to have the tool bar present, set this to yes. The toolbar is the menu at the top of your web browser.

directories - if you set this to yes, you'll have the preset links on your browser listed at the top of the popup.

status - this will show the status bar at the bottom of your web browser - the bit that shows you where the link leads to, and the progression of the page loading.

scrollbars - you can set this to either yes or no, depending on the amount of content you have on the popup. It's usually best to set it to 'yes'.

resizable - if you want your visitors to be able to adjust the size of the popup, then set this to yes. If you have a specific background which will tile if the popup window is too big, then I'd keep this at a 'no'.

The Width & Height obviously dictate how large you want the window to be. It's set to 500x300 in the example, which is the size of this current window.

So those are what the properties mean! And thats all there is to it!





Syndarys.net, Designed by Syndarys©2003-2008