100、链接处变换色彩

100、链接处变换色彩

脚本说明:

第一步:把如下代码加入<head>区域中

<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",

"yellow",

"lime",

"coral",

"palegreen",

"silver",

"gold",

"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>

 

那么链接处就会出现彩色字体

注意:不能在<style>中定义好链接颜色

Write a comment

Comments: 0