Dancing Link Colours
Created | Updated Jan 28, 2002
The colour of this link should change before your very eyes (Netscape users: click Refresh to see it change).
How you do dat?
Paste everything between the horizontal lines, after the <BODY> tag of your home page source:
<!-- Cut-N-Paste JavaScript from ISN Toolbox
Copyright 1996, Infohiway, Inc. Restricted use is hereby
granted (commercial and personal OK) so long as this code
is not *directly* sold and the copyright notice is buried
somewhere deep in your HTML document. A link to our site
http://www.infohiway.com is always appreciated of course,
but is absolutely and positively not necessary. -->
<script language="JavaScript">
<!--
function initArray() {
for (var i = 0; i < initArray.arguments.length; i++) {
this[i] = initArray.arguments[i];
}
this.length = initArray.arguments.length;
}
// you may fill this colors array with your colors.
// the script will rotate the links through these colors
var colors = new initArray(
"#ffffff",
"#ffffef",
"#ffffdf",
"#ffffcf",
"#ffffbf",
"#ffffaf",
"#ffff9f",
"#ffff8f",
"#ffff7f",
"#ffef7f",
"#ffdf7f",
"#ffcf7f",
"#ffbf7f",
"#ffaf7f",
"#ff9f7f",
"#ff8f7f",
"#ff7f7f",
"#ff7f8f",
"#ff7f9f",
"#ff7faf",
"#ff7fbf",
"#ff7fcf",
"#ff7fdf",
"#ff7fef",
"#ff7fff",
"#ff8fff",
"#ff9fff",
"#ffafff",
"#ffbfff",
"#ffcfff",
"#ffdfff",
"#ffefff");
pause_time = .3; // in seconds
link = 0; // starting color index (in colors array) for unvisited links
vlink = 4; // starting color index (in colors array) for visited links
function linkDance() {
link = (link+1)%colors.length;
vlink = (vlink+1)%colors.length;
//alert("link "+link+"\r\nvlink "+vlink+"\r\nvlinkColor "+document.vlinkColor);
document.linkColor = colors[link];
document.vlinkColor = colors[vlink];
setTimeout("linkDance();",pause_time*1000);
}
linkDance();
// -->
</script>
IMPORTANT: Please remember the copyright notice. You like the script? Then support the guys who wrote it!