js实现字体渐渐消失
view plaincopy to clipboardprint?
<HTML>
<HEAD>
<SCRIPT language=JavaScript>
var col = new Array();
col[15] = '#000000';
col[14] = '#111111';
col[13] = '#222222';
col[12] = '#333333';
col[11] = '#444444';
col[10] = '#555555';
col[9] = '#666666';
col[8] = '#777777';
col[7] = '#888888';
col[6] = '#999999';
col[5] = '#AAAAAA';
col[4] = '#BBBBBB';
col[3] = '#CCCCCC';
col[2] = '#DDDDDD';
col[1] = '#EEEEEE';
col[0] = '#FFFFFF';
var i = col.length;
var isOut = true;
function Over()
{
if (i>=0 && isOut) {i--;td.style.color=col[i];}
else if(i<= col.length && !isOut){i++;td.style.color=col[i]; }
else{isOut = !isOut;}
setTimeout('Over()',100);//渐变
}
</SCRIPT>
<TABLE><TBODY><TR><TD id=td onmouseover=Over()>鼠标放上看效果</TD></TR></TBODY></TABLE> <PRE></PRE>