A dd the option of allowing links on your page to be opened in a new window with this powerful script. A simple checkbox toggles between current and new window. This is a practical script that works cross browser.
Y ou can now designate whether links should open in a completely new window each time (default), or a set secondary window. On pages where there is a lot of activity, the later can greatly reduce the annoyance factor of spawning a new window for each link.
We have tested the code in IE6.0, Firefox1.5.0.6, Opera9.01, Netscape8.1 and AOL Explorer1.2. This script worked well in all platforms with no variations observed.
D epending on your knowledge of HTML and javascript, this is an easy, two step copy and paste code with only one possible reconfiguration. The first part goes in the <HEAD> section of your document and the second part goes anywhere in the <BODY> section of your document where you want the selection box to appear.
A s we stated earlier, there is only one possible reconfiguration within this code. This is in the <BODY> section. The reconfiguration is within the selection box as to having the box checked on page opening (default) or unchecked on page opening. This is your preference as to which you prefer. See below are where this reconfiguration is.
Default Code (Checked)
<FORM name="targetform"><INPUT TYPE="checkbox" NAME="targetnew" ONCLICK="hyperlinks(this.checked)" checked> <b>Open links in secondary window</b></FORM>
The above by default will have the box selected on page opening. To change that to being unchecked on page opening, just remove the word "checked". See below example:
<FORM name="targetform"><INPUT TYPE="checkbox" NAME="targetnew" ONCLICK="hyperlinks(this.checked)"> <b>Open links in secondary window</b></FORM>
O n the below section of code, the text for you to tell your guests to check the box can be changed to whatever wording you prefer. See below:
<FORM name="targetform"><INPUT TYPE="checkbox" NAME="targetnew" ONCLICK="hyperlinks(this.checked)" checked> <b>Open links in secondary window</b></FORM>This effect will Not" work if you already have the link defined with the attribute of target="_blank"or target="new" etc. to open the link in a new window. This attribute will override the script. In other words if we have the attribute of target="new", etc. associated with an individual link and we "Deselect" the "Open Links In Secondary Window", this link will still open in a new or secondary window.
<a href="URL Goes Here"target="_blank">[ Try Me ]</a>
<a href="URL Goes Here">[ Try Me ]</a>
W
e hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our [ FAQ ] and if you can't find the answer there, [ contact us ].
[ Get Code Here ]
[ Rate This Page ]
Search Our Site By Individual letter
[ A ]
[ B ]
[ C ]
[ D ]
[ E ]
[ F ]
[ G ]
[ H ]
[ I ]
[ J-K ]
[ L ] |
Little Tips Directory [ Page 1 ] [ Page 2 ] [ Page 3 ] [ Page 4 ] [ Page 5 ] [ Page 6 ] [ Page 7 ] |
[ Index Page 1 ]
[ Index Page 2 ]
[ Index Page 3 ]
[ Index Page 4 ]
[ Index Page 5 ] [ Index Page 6 ] [ Index Page 7 ] [ Index Page 8 ] [ Index Page 9 ] [ Index Page 10 ] [ Index Page 11 ] [ Index Page 12 ] [ Index Page 13 ] [ News Letter Archives ]
[ Navigation Page ]
[ Archives Of Published Material ] |
If you are part of the ever growing number of webmasters who enjoy
sharing your knowledge with others on web design, join The
Consigliere Ltd. web ring to broaden your scope of exposure.
Join Today
This Site Was Built And Is Maintained Exclusively by
The Webmaster @ Consigliere Ltd.
Copyright © Consigliere Ltd., All Rights Reserved. 2001-