📄 ch14-207.txt
字号:
<HTML>
<HEAD>
<TITLE>页面背景篇--闪烁星空</TITLE>
</HEAD>
<BODY bgcolor="#fef4d2" onload=Start() onunload=End()>
<br><br>
<center>
<font color="ffaafa"><h2>页面背景篇--闪烁星空</h2></font>
<hr width=300>
<br><br>
<!-- 案例代码开始 -->
<script language=JavaScript>
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];
}
for(i=1;i<=10;i++){
document.write("<div id=\"Picture004"+i+"\" style=\"position:absolute;top:80%;left:"+(Math.floor(Math.random()*5)+9*(i-1))+"%;width:21;height:21;visibility:hidden;\"><dd><img src=\"Picture004.gif\" WIDTH=\"21\" HEIGHT=\"21\"></dd></div>");
}
function Start(){
setInterval("randommove()",1000);
set_visible();
setTimeout("bar_show()",2000);
}
function randommove(){
for(i=1;i<=10;i++)
eval("Picture004"+i+".style.top=get_top()");
}
function get_top(){
var t,t2;
t=Math.floor(Math.random()*380);
t2=t.toString()+"px";
return(t2);
}
function bar_show(){
bar.style.visibility="visible";
}
function set_visible(){
for(i=1;i<=10;i++)
eval("Picture004"+i+".style.visibility=\"visible\"");
banner.style.visibility="visible";
friends.style.visibility="visible";
high(pic);
}
function End(){
banner.style.visibility="hidden";
friends.style.visibility="hidden";
pic.style.visibility="hidden";
}
function killErrors() {
return true;
}
window.onerror = killErrors;
</script>
<!-- 案例代码结束 -->
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -