Multiple links Open
A reader asked if she can make anavigation tab open more than one link when clicked. The answer is YES it can be done, with the help from a small Javascript.
(Now if you came here looking for a way YOU can open multiple links on pages you visit, try Snap Links, a Firefox addon.)

First let’s look at an HTML code for a regular anchor tag <a>:
Eg:
<a href="YOUR_URL" target="_blank">Link text</a>
When clicked, this code will open YOUR_URL in a new window/tab.
To add another link, just add the code below before the closing bracket “>” in the opening tag:
Eg: onclick="window.open("YOUR_2nd_URL");"
It will open YOUR_2nd_URL in a second new window/tab. To add more links, simply add more
window.open(); before the closing quotation mark.
So if you were to open three links, your anchor will look like this:
Eg:
<a href="YOUR_URL" target="_blank" onclick="window.open(""YOUR_2nd_URL""); window.open(""YOUR_3rd_URL"");">Link text</a>
This is an example of an anchor that opens three links (in three windows or tabs) in a single click: Eg : <a href="http://bloggersentral.blogspot.com/" target= onclick="window.open("http://www.tourism.gov.my/"); window.open("http://www.tic.kelantan.gov.my/");">This anchor opens three links in a single click</a>

0 comments:
Post a Comment