<html> <head> <title> </title> <script language="JavaScript"> <!-- spot_width = 50 brightness = 6 function highlight() { var linkQty = document.getElementsByTagName('a') for(a=0;a<linkQty.length;a++) { if(document.getElementsByTagName('a')[a].type=='fader') { hlink=document.getElementsByTagName('a')[a] hlink_centerX=hlink.offsetLeft+(hlink.offsetWidth/2) hlink_centerY=hlink.offsetTop+(hlink.offsetHeight/2) distance = Math.round(Math.sqrt(((event.x-hlink_centerX)*(event.x-hlink_centerX)) + ((hlink_centerY-event.y)*(hlink_centerY-event.y))))+spot_width if (isNaN(distance))distance = 0 if(distance>255)distance=255 val=(255-distance) var col=toHex(val) hlink.style.color = '#'+col+'AF'+col } } } function toHex(hex) { var hex_val = hex.toString(16).toUpperCase(); if (hex_val.length == 1){ var temp = "0" + hex_val hex_val = temp; } return hex_val } document.onmousemove=highlight //--> </script> </head> <body> <center> <span style="font-family:ms sans serif;font-size:25;z-index:0;"><u>Cool Links</u> <br><br> <font size="2" face="ms sans serif"> <ul> <li>Easy to change characteristics. </ul> </font> <br><br> <font size="2" face="ms sans serif"> <br> The links in the text below will begin changing color as the mouse moves closer to or farther from them. <br><br> Text Text Text Text Text <a href="javascript:void(0)" type="fader" style="color:00AF0C;font-family:verdana;font-size:10;"><b>Link Item</b></a> Text Text Text Text <a href="javascript:void(0)" type="fader" style="color:00AF0C;font-family:verdana;font-size:10;"><b>Link Item</b></a> Text Text Text Text <a href="javascript:void(0)" type="fader" style="color:00AF0C;font-family:verdana;font-size:10;"><b>Link Item</b></a> Text Text Text Text Text<br> </font> </center> </body> </html> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]