[#] Zewnętrzne linki w nowym oknie

( Ostatnio zmieniony pon., 30/06/2008 - 13:54 )
 
function externalLinks() {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors .length; i++) {
  var anchor = anchors[i];
  if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
      anchor.target = "_blank";
      anchor.title = (anchor.title != "") ? anchor.title+" (opens in a new window)" : "";
      anchor.className = (anchor.className != '') ? anchor.className+' external' : 'external';
  }
    }
}
window.onload = externalLinks;
5
Twoja ocena: Brak Średnio: 5 (2 głosy)