[ ActiveLink]
Bei Einsatz
dieses Scripts bleibt der zuletzt aktivierte Link so lange farblich unterlegt,
bis ein anderer Link aktiviert wird. Lesen Sie hierzu auch die ausführliche
Beschreibung des Scripts.
Eine
Variante mit Grafiken finden Sie hier .
[Kompatibilität]
[ zwischen <HEAD> und </HEAD>]
<style
type="text/css">
body {margin:100px}
#cont {position:relative;width:125px;}
#cont a
{color:blue;text-decoration:none;font-size:16px;font-weight:bold;}
#cont a:hover
{color:blue;text-decoration:underline;font-size:16px;font-weight:bold;}
</style>
<script language="JavaScript">
/**************************************************************
Script made by Martial Boissonneault http://getElementById.com/
This script is provided free to the web development community.
**************************************************************/
function
Active(num) {
for(i=0;i<obj.length;i++)
obj[i].style.color = "blue";
obj[num].style.color = "red";
}
function
Init() {
if(document.getElementById){
obj = document.getElementById("cont").getElementsByTagName("a");
for(i=0;i<obj.length;i++)
obj[i].onfocus=new Function("if(this.blur)this.blur()");
obj[0].style.color = "red";
}
}
onload=Init;
</script>
[ zwischen <BODY> und </BODY>]
<div
id="cont">
<a href="# "
onclick="Active(0)">link no.1 </a><br>
<a href="# "
onclick="Active(1)">link no.2 </a><br>
<a href="# "
onclick="Active(2)">link no.3 </a><br>
<a href="# "
onclick="Active(3)">link no.4 </a>
</div>
[ ]
Martial
Boissonneault
[ ]
Kopieren Sie
bitte den Code