Danny: Farbe eines Links dynamisch ändern

Beitrag lesen

<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="styles/bottom.css">
<script language="JavaScript" type="text/javascript" src="scripts/ultrasniff.js"></script> <!-- Include complex Browser Sniff -->
<script language="JavaScript" type="text/javascript" src="scripts/dhtml.js"></script> <!-- Include complex DHTML-Functions -->
<script language="JavaScript">

<!-- ALL FOLLOWING CODE BY DANNY REHS, (C) -->

/*
 // arg e.g.:
 homeN = new Array();
 homeN[0]=["Home","homeB","homeS"];
 homeN[1]=["Willkommen","content/home/welcome.html"];
 homeN[2]=["Über IG","content/home/about.html"];
 homeN[3]=["Sitemap","content/home/sitemap.html"];
 homeN[4]=["Impressum","content/home/impressum.html"];
 // actI = actual array[i]
*/

activeLinkC = "#ffffe0"; oldLinkC = "#e0e0ff";
oldMarkO = null;

function writeNavPath(arg, actI) // IE4+ // may run in NS4+ ? // but not in Opera
{
 var basis = arg[0][0];
 var nav = '<table cellpadding=0 cellspacing=0 border=0 style="filter:dropshadow(color=#000000, offx=2, offy=2)"><tr>';
 nav += '<td><b>' +basis +'</b>  >>  </td>';
 for(var ai=1; ai<arg.length; ai++)
 {
  var text = arg[ai][0]; var link = arg[ai][1];
  nav += '<td><a id='+ai+' href="'+link+'" target="main" onFocus="this.blur()" onClick="markLink(this.id)">'+text+'</a></font></td>';
  if(ai < arg.length-1)  nav += '<td> ·· </td>';
 }
 nav += '</tr></table>';

navPathO = getLayer("navPathDivI"); // dhml.js
 writeToLayer(navPathO, nav); // dhtml.js // this sucks in Opera!
 markLink(actI);
}

function markLink(id)
{
 if(oldMarkO != null)  setLinkColor(oldMarkO, oldLinkC);
 linkO = getLayer(id); // dhtml.js
 setLinkColor(linkO, activeLinkC); oldMarkO = linkO;
}

function setLinkColor(linkO, linkC) // auslagern!
{
 if(ie4up || ns6up)  linkO.style.color = linkC;
}

</script>
</head>

<body marginheight=0 marginwidth=0>

<table height=100%><tr>
<td align=left valign=top nowrap>
<div id="navPathDivI" style="position:absolute"></div></td>
</tr></table>

<!-- published 5.3.2002, 17:20  ::  updated 6.3.2002, 09:50 -->

</body>
</html>

/*** bottom.css ***/

/* Body .Default: */

body {
 font-family:Verdana,Helvetica,sans-serif; font-size:10px;
 color:#e0e0ff; background-color:#343058;
 scrollbar-3d-light-color:#140024; scrollbar-arrow-color:#9988aa; scrollbar-darkshadow-color:#140024; scrollbar-face-color:#140024; scrollbar-highlight-color:#9988aa; scrollbar-shadow-color:#9988aa; scrollbar-track-color:#201030;
 margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;
}

/* Tabelle .Default: */

td {
 font-family:Verdana,Helvetica,sans-serif; font-size:10px;
 color:#e0e0ff;
 margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;
}

/* Link .Default: */

a { font-family:Tahoma,Helvetica,sans-serif; font-size:11px; }
a:link { color:#e0e0ff; text-decoration:none; font-weight:bold; }
a:visited { color:#e0e0ff; text-decoration:none; font-weight:bold; }
a:hover { color:#ffffe0; text-decoration:none; font-weight:bold; }
a:active { color:#ffffff; text-decoration:underline; font-weight:bold; }
a:focus { color:#8080ff; text-decoration:underline; font-weight:bold; }

/* Link .Navigation Pfad: */

a.navPath { font-size:10px; font-family:Tahoma,Helvetica,sans-serif; }
a.navPath:link { font-size:10px; font-weight:bold; color:#e0e0ff; text-decoration:none; }
a.navPath:visited { font-size:10px; font-weight:bold; color:#e0e0ff; text-decoration:none; }
a.navPath:hover { font-size:10px; font-weight:bold; color:#ffffe0; text-decoration:none; }
a.navPath:active { font-size:10px; font-weight:bold; color:#ffffff; text-decoration:underline; }
a.navPath:focus { font-size:10px; font-weight:bold; color:#8080ff; text-decoration:underline; }