js实现字体渐渐消失
get新技能是需要付出行动的,即使看得再多也还是要动手试一试。今天图老师小编跟大家分享的是js实现字体渐渐消失,一起来学习了解下吧!
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
TABLETBODYTRTD id=td onmouseover=Over()鼠标放上看效果/TD/TR/TBODY/TABLE PRE/PRE