Peter
Junior Member
Coding God
Posts: 50
|
Post by Peter on Apr 29, 2006 13:23:42 GMT
<script type="text/javascript"> <!-- /* Flashing color chaning PM link.
Created by Peter
This code cannot be reposted at anywhere other than SSDesigns or ProBoards, without permission.
This header must stay intact at all times. */
// Speed of changing colours var flashSpeed = 100;
// How many times it repeats; var cycleLength = 4;
//change the colours below var colors = ["red", "green", "yellow", "blue"];
var re = />,\s(\d+)\s(are|is)\s/i var tCycles = curColor = 0;
function cColors(){ if(document.getElementsByTagName("table").item(0).innerHTML.match(re)){ if(RegExp.$1 >= 1){ curColor = (curColor == 3) ? 0 : ++ curColor; document.getElementsByTagName("a").item(0).style.color = colors[curColor]; if(tCycles ++ < Math.floor(cycleLength * cycleLength)){ var inter = setTimeout("cColors()", flashSpeed); } else { document.getElementsByTagName("a").item(0).style.color = colors[0]; clearTimeout(inter); } } else { return false; } } }
cColors();
//--> </script>
Add to global headers.
You can add more colors to the array in the top of the script.
|
|