Often there are times when we don’t want to take web site visitors away from a page but wish to insert further information to help clarify an idea or subject. A good solution is windows that are set to a specific size.
By pre-determining the size of window when a link is clicked, we no longer run the risk of swamping the original page. We are also satisfying the need to explain a concept and, at the same time, maintaining how we would wish visitors to navigate.
The following script allows us to:
• open links in a new window
• control the size
• and set the appearance of the window
The script below should be inserted into the <head> area of the web page.
<SCRIPT language="JavaScript">
function open1() {
var open1 =
window.open(‘URL of the first target link ','','scrollbars=yes,height=450,width=450,resizable=yes');
}
function open2() {
var open2 =
window.open(‘URL of the second target link','','scrollbars=yes,height=600,width=500,resizable=yes');
}
function open3() {
var open3 =
window.open('URL of the third target link','','height=240,width=290,resizable=yes');
}
// -->
</SCRIPT>
Adjust the height and width settings to suit. The second part of script below is then inserted into the <body> area of the web page where you want the links to appear.
<A href="javascript:open1()" title="First link’s description goes here" style="font:bold 11px verdana;color:#000000;text-decoration:underline;">hyperlinked text here</A><br>
<A href="javascript:open2()" title="Second link’s description goes here" style="font:bold 11px verdana;color:#000000;text-decoration:underline;">hyperlinked text here</A><br>
<A href="javascript:open3()" title="Third link’s description goes here" style="font:bold 11px verdana;color:#000000;text-decoration:underline;">hyperlinked text here</A>
The title part of the script generates the equivalent of image alt text for the hyperlink. We covered that previously. See here.
There are tons of applications for this kind of script where the narrative, so to speak, of your web site requires the equivalent of a footnote.
Another interesting use for this script is as a photo gallery where the URLs in the part of the script are to full size images and the part of the script contains not hyperlink text, but thumbnails.