Advertisement
rutera

Color links

Dec 27th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script language="JavaScript">
  2. <!--
  3. function initArray() {
  4. for (var i = 0; i < initArray.arguments.length; i++) {
  5. this[i] = initArray.arguments[i];
  6. }
  7. this.length = initArray.arguments.length;
  8. }
  9.  
  10. // ot tuk se naglasqt cvetovete
  11. var colors = new initArray(
  12. "#008000",
  13. "green",
  14. "#C6C68C",
  15. "green",
  16. "blue",
  17. "purple",
  18. "black",
  19. "red");
  20.  
  21. pause_time = .5; // pauza prez 5 sekundi
  22.  
  23. link = 0; // starting color index (in colors array) for unvisited links
  24. vlink = 4; // starting color index (in colors array) for visited links
  25.  
  26. function linkDance() {
  27. link = (link+1)%colors.length;
  28. vlink = (vlink+1)%colors.length;
  29. //alert("link "+link+"\r\nvlink "+vlink+"\r\nvlinkColor "+document.vlinkColor);
  30. document.linkColor = colors[link];
  31. document.vlinkColor = colors[vlink];
  32. setTimeout("linkDance();",pause_time*1000);
  33. }
  34. linkDance();
  35. // -->
  36. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement