Launching a small pop up window
Sometimes, you may want things to launch in a new window that does not have the address bar,
buttons at the top, etc.
You can achieve this with a little bit of Javascript like this example:
Click me!!!
You can do this in a few easy steps.
Step 1 -
Copy this Javascript, and paste it between the
<head>
and
</head>
tags in your HTML document:
<script language="Javascript">
function open_smallwindow(url) {mywin = window.open(url,"small",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=565,height=250,top=210,left=135');}
</script>
Step 2 -
Make your link using this code:
<a href="javascript:open_smallwindow('little_page.html')">Click me!!!</a>
You can make this link to a page or an image on your own site, or to a page on another site.
Step 3:
Now, go back to that mess of code that you put between your <head> tags, and modify a few things
<script language="Javascript">
function open_smallwindow(url) {mywin = window.open(url,"small",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=565,height=250,top=210,left=135');}
</script>
-
toolbar, location, directories, status, menubar and scrollbars can be set to 0 for "don't show"
or to "1" for "show".
-
width and height are in pixel values, and determine the size of the popup window being launched
-
top and left are in pixel values, and control the location of where the popup window happens,
from the top and left corner of the monitor (not of the browser)
Troubleshooting -
Make sure that this code is all on the same line:
function open_smallwindow(url) {mywin = window.open(url,"small",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=565,height=250,top=210,left=135');}
It's OK if it wraps to the next line in your HTML text editor. Just don't insert any line breaks in the line, or the script
(probably) won't work.
<< Back to Home