|
自动变颜色的连接文本
以下是代码片段: <html>
</head>
<body>
<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>
<p><a target="_blank" href="http://linkweb.cn/js">网页特效</a></p>
</body>
</html>
检测代码效果 请进
|