Created
March 11, 2015 18:33
-
-
Save vikt82/d11ae0199d2a14287f23 to your computer and use it in GitHub Desktop.
ссылка изменяющая цвета
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Сылка изменяющая цвета | |
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment