一个字符串,由多个字符组成,开始的时候是灰色的,慢慢地变成了蓝色的字,感觉像有一个灰色的层挡住蓝色的字,慢慢的层移开。这种效果
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>javascript逐渐变色的字</title>
<style>
div{
position:absolute;
width:1000px;
}
strong{
font-size:50px;
color:#ddd;
font-family:黑体;
position:absolute;
top:0;
left:0;
}
.blue{
color:blue;
width:0;
overflow:hidden;
white-space:nowrap;
z-index:20;
};
</style>
</head>
<body>
<div>
<strong id="Title">www.aspprogram.cn,专业的asp编程网站</strong>
</div>
<script>
var down=document.getElementById("Title"),up=down.cloneNode(true),i=0;
up.className=’blue’;
down.parentNode.appendChild(up);
setInterval(‘up.style.width=i+++"px"’,10);
</script>
</body>
</html>
[/code]