»
AnglaisFrançaisVietnamien

Imprimer - Lien Enhancer - JavaScriptBank.com

Version complète: jsB@nk » Lien » Lien Enhancer
URL: https://www.javascriptbank.com/link-enhancer-index.html

Lien Enhancer © JavaScriptBank.comL'utilisation de ce script, les liens sortants est ouvert dans une nouvelle fenêtre automatiquement. Pas besoin d'ajouter quoi que ce soit pour le lien. Le script va également appliquer un style différent à la sortie de lien pour permettre aux visiteurs de conscience, il est un lien sortant. Vous n'avez pas à vous inquiéter plus d'objectifs et de l'apparition, surtout si vos clients ont leur propre CMS.

Version complète: jsB@nk » Lien » Lien Enhancer
URL: https://www.javascriptbank.com/link-enhancer-index.html



CSS
<style type="text/css">.link_ext { height: 20px; background: url(link_ext.gif) no-repeat right 4px; padding: 0 13px 0 0;}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script type="text/javascript">/* -----------------------------------------------   Link Enhancer - v.1.1   (c) 2007 www.haan.net   contact: jeroen@haan.net   You may use this script but please leave the credits on top intact.   Please inform us of any improvements made.   When useful we will add your credits.  ------------------------------------------------ */  // Give the outbound links a blank target and their own style// and optional the inbound too or vise versa// It will leave the mailto alone and skip anchor tags without the href attributefunction enhanceLinks() { var links = document.getElementsByTagName("a"); var thisDomain = document.domain.split('www.'); var thisDomain = (thisDomain[1]) ? thisDomain[1] : document.domain ; for (var i = 0; i < links.length; i++) {  if(links[i].href.indexOf(thisDomain) == -1 && links[i].href != '') {   links[i].target = '_blank';   links[i].className = 'link_ext';  }// or else do this too if you like// else // {//links[i].target = '_self';//links[i].className = 'link_int';// }}}// Multiple onload function created by: Simon Willison// http://simon.incutio.com/archive/2004/05/26/addLoadEventfunction addLoadEvent(func) {  var oldonload = window.onload;  if (typeof window.onload != 'function') {    window.onload = func;  } else {    window.onload = function() {      if (oldonload) {        oldonload();      }      func();    }  }}addLoadEvent(function() {  enhanceLinks();});</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<ul>  <li><a href="http://www.javascriptbank.com/">Web Developer</a></li>  <li><a href="http://javascriptbank.com/">JavaScript Source</a></li></ul><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


Files
http://javascriptbank.com/javascript/link/Link_Enhancer/link_ext.gif