博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

超连接文字变色五彩变色

Posted on 2009-03-16 16:43  ^_^木头人  阅读(126)  评论(0)    收藏  举报
<script language="JavaScript">
<!-- Begin
function initArray() {
for (var i = 0; i < initArray.arguments.length; i++{
this[i] = initArray.arguments[i];
}

this.length = initArray.arguments.length;
}

var colors = new initArray(
"red",
"blue",
"green",
"purple",
"black",
"tan",
"red");
delay 
= .5// seconds
link = 0;
vlink 
= 0;
function linkDance() {
link 
= (link+1)%colors.length;
vlink 
= (vlink+1)%colors.length;
document.linkColor 
= colors[link];
document.vlinkColor 
= colors[vlink];
setTimeout(
"linkDance()",delay*1000);
}

linkDance();
// End -->
</script><a href="#">adsfsdf</a>