星星闪烁问题 请好心人 指点一下
<meta http-equiv="Content-Language" content="zh-cn"><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<head>区域中
<SCRIPT language=javascript1.2>
<!--
hexa = new Array(16);
for(var i = 0; i < 10; i++) hexa[i] = i;
hexa[10]="a";
hexa[11]="b";
hexa[12]="c";
hexa[13]="d";
hexa[14]="e";
hexa[15]="f";
function hex(i)
{
if (i < 0) return "00";
else if (i > 255) return "ff";
else return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}
function setbgColor(r, g, b)
{
var hr = hex(r);
var hg = hex(g);
var hb = hex(b);
document.bgColor = "#"+hr+hg+hb;
}
function fade(sr, sg, sb, er, eg, eb, step)
{
for(var i = 0; i <= step; i++)
{
setbgColor( Math.floor(sr * ((step-i)/step) + er * (i/step)),
Math.floor(sg * ((step-i)/step) + eg * (i/step)), Math.floor(sb *
((step-i)/step) + eb * (i/step)));
}
}
//-->
</SCRIPT>
第二步:把如下代码加入<body>区域中
<SCRIPT language=javascript1.2>
<!--
for(i=1;i<=10;i++)
{
document.write("<div id=\"star"+i+"\" style=\"position:absolute;top:80%;left:"+(Math.floor(Math.random()*5)+9*(i-1))+"%;width:21;height:21;visibility:hidden;\"><dd><img src=\"star.gif\" WIDTH=\"21\" HEIGHT=\"21\"></dd></div>");
}
function randommove()
{
for(i=1;i<=10;i++)
eval("star"+i+".style.top=get_top()");
}
function get_top()
{
var t,t2;
t=Math.floor(Math.random()*380);
t2=t.toString()+"px";
return(t2);
}
function set_visible()
{
for(i=1;i<=10;i++)
eval("star"+i+".style.visibility=\"visible\"");
banner.style.visibility="visible";
friends.style.visibility="visible";
high(pic);
}
function bar_show()
{ bar.style.visibility="visible"; //bar在这里是什么意思?
}
function start_it()
{
fade(255,255,255, 0,0,0, 50);
setInterval("randommove()",1000);
set_visible();
setTimeout("bar_show()",2000);
function end_it()
{
banner.style.visibility="hidden"; banner在这里是什么意思?
friends.style.visibility="hidden"; friends在这里是什么意思?
pic.style.visibility="hidden"; pic在这里是什么意思?
fade(0,0,0,255,255,255,10);
}
-->
</SCRIPT>