Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (59.84 KB, 1 trang )
Link đổi màu tự động
1. <script LANGUAGE="JavaScript">
2.
3. <! This script and many more are available free online at >
4. <! The JavaScript Source!! >
5.
6. <! Begin
7. function initArray() {
8. for (var i = 0; i < initArray.arguments.length; i++) {
9. this[i] = initArray.arguments[i];
10. }
11. this.length = initArray.arguments.length;
12. }
13. var colors = new initArray(
14. "red",
15. "blue",
16. "green",
17. "purple",
18. "black",
19. "tan",
20. "red");
21. delay = .5; // seconds
22. link = 0;
23. vlink = 2;
24. function linkDance() {
25. link = (link+1)%colors.length;
26. vlink = (vlink+1)%colors.length;
27. document.linkColor = colors[link];
28. document.vlinkColor = colors[vlink];
29. setTimeout("linkDance()",delay*1000);
30. }