|
|
| Opening links in a New Window | This can know be done with Office Live, when creating a hyperlink check the Open Link in a New Window. 
| | | Open Navigation Links in a New Window | Paste the following codes into the HTML module: Open All Navigation Links in New Window
For Top Navigation: <script type="text/javascript"> var nlinks = parent.document.getElementById('IWS_WH_Elem_TopNav').getElementsByTagName('a'); for (var l = 0; l < nlinks.length; l++){ nlinks[l].target= '_blank'; } </script> For Side Navigation: <script type="text/javascript"> var nlinks = parent.document.getElementById('IWS_WH_Elem_LeftNav').getElementsByTagName('a'); for (var l = 0; l < nlinks.length; l++){ nlinks[l].target= '_blank'; } </script> Open specific Links in a New Window: The code below is set to open navigation links 1, 3, 6, 9, 11 in new window. To add more links just add more link[#] or remove as needed,. To change which links open in new window change the number, navigation links start from 0, so 0 would actually open navigation link 1 (probably your Home Page). Once you are done modifying the code, paste it into the HTML module, you will have to paste the code into every page you wish to have the links open in a new window. Depending on which type of navigation you using you should only need one code either top or left.
For Top Navigation: <script type="text/javascript"> /*Provided By -OSWC (Open Source Webmaster Center) @ http://TheXbanners.com - Free 4 All*/ var p = parent.document; var link = p.getElementById('IWS_WH_Elem_TopNav').getElementsByTagName('a'); var target_links = [link[0],link[2],link[5],link[8],link[10]]; for (var l = 0; l < target_links.length; l++){ target_links[l].target = '_blank'; } </script> For Side Navigation: <script type="text/javascript"> /*Provided By -OSWC (Open Source Webmaster Center) @ http://TheXbanners.com - Free 4 All*/ var p = parent.document; var link = p.getElementById('IWS_WH_Elem_LeftNav').getElementsByTagName('a'); var target_links = [link[0],link[2],link[5],link[8],link[10]]; for (var l = 0; l < target_links.length; l++){ target_links[l].target = '_blank'; } </script> | | Footer Link | Paste the following code into the HTML module: Open All footer links in New Window
<script type="text/javascript"> /*Provided By -OSWC (Open Source Webmaster Center) @ http://TheXbanners.com - Free 4 All*/ var flinks = parent.document.getElementById('IWS_WH_Elem_Footer').getElementsByTagName('a'); for (var l = 0; l < flinks.length; l++){ flinks[l].target= '_blank'; } </script> Open specific links in the footer in a New Window The code below is set to open footer links 1, 3, 6, 7 in new window. To add more links just add more link[#] or remove as needed, footer links start from 0, so 0 would actually open link 1. Once you are done modifying the code, paste it into the HTML module, you will have to paste the code into every page you wish to the links open in a new window.
<script type="text/javascript"> /*Provided By -OSWC (Open Source Webmaster Center) @ http://TheXbanners.com - Free 4 All*/ var p = parent.document; var link = p.getElementById('IWS_WH_Elem_Footer').getElementsByTagName('a'); var target_links = [link[0],link[2],link[5],link[6]]; for (var l = 0; l < target_links.length; l++){ target_links[l].target = '_blank'; } </script> | | Open all External Links in a New Window | This includes navigation, body, and all footer links that reference an external site/domain. Just replace the myurl.com with your url, you don't need http:// or www. Once you have modified the code paste it into the HTML module. You will also need to download the to display next to your link, click here to download. <script type="text/javascript"> /************************ * External links script by - OSWC * @ http://TheXbanners.com *************************/ var links,domain,where,d,p; p = parent.document; d = document; domain = 'myurl.com'; where = 'page'; function setlinksVar(){ if (where == 'page'){ links = p.getElementsByTagName('a'); } else if (where == 'module'){ links = d.getElementsByTagName('a'); } } function externalLinks(){ for (var l = 0; l < links.length; l++){ if (links[l].href.indexOf(domain) == -1 && links[l].href.indexOf('http://') != -1){ links[l].target = '_blank'; links[l].title += ' - Opens In A New Window'; links[l].style.background = 'url(/images/ext_link.gif) no-repeat right 4px'; links[l].style.padding = '0 14px 0 0'; } } } setTimeout('setlinksVar();', 0); setTimeout('externalLinks();', 0.5); </script> |
| |
|