Skip to content

Instantly share code, notes, and snippets.

@vikt82
Created March 11, 2015 18:33
Show Gist options
  • Select an option

  • Save vikt82/d11ae0199d2a14287f23 to your computer and use it in GitHub Desktop.

Select an option

Save vikt82/d11ae0199d2a14287f23 to your computer and use it in GitHub Desktop.

Revisions

  1. vikt82 created this gist Mar 11, 2015.
    35 changes: 35 additions & 0 deletions link_color.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    Сылка изменяющая цвета
    <script>

    var colors = new Array(
    "#008000",
    "green",
    "#000000",
    "#D3CF18",
    "#C6C68C",
    "green",
    "blue",
    "darkblue",
    "purple",
    "black",
    "red",
    "lime",
    "yellow");
    var colorCounter=0;
    var timeoutId;
    var hoverLink;

    window.onload=function(){
    var as=document.getElementsByTagName("a");
    for(var i=0;i<as.length;i++){
    as[i].onmouseover=function(){
    if(this.style)hoverLink=this;
    hoverLink.style.color=colors[colorCounter++];
    colorCounter%=colors.length;
    timeoutId=setTimeout(hoverLink.onmouseover,400);
    }
    as[i].onmouseout=function(){clearTimeout(timeoutId);hoverLink.style.color=document.linkColor;}
    }
    }

    </script>