( s; n1 j8 H* ~, G; m/ i$ s
3 ?" I0 u( P0 J' M- n2 I( ]: e
% H& J& e. |) o G8 F
8 W1 Y ?- `/ M0 O5 k4 Z一 复制程式码到<body>之后:
: h" Q( _; J- ^8 K) ]7 P
2 N$ E) t# S, L" W<------------- 插入控制码区段开始 ------------>
- c% ^( D7 b2 a+ k<script language="JavaScript"> ) z% N! p2 c& I6 P7 C3 h# [
cOlOuRs=new Array("abbbff","ffffee","ffff7a","dffffd","ffaaa0","ffddd0") 6 L, ]" F' C+ J# `& j4 K
S_amount = 30;//number of small stars!!!!!
$ O0 W3 M3 x; i4 K; f( TL_amount = 15;//number of larger stars!!!! + [+ R" r0 V1 f" e( ?
S_Ypos = new Array();
' ?% M8 b% G% ?- CS_Xpos = new Array(); 7 A" e# g: j, A0 ~; p
L_Ypos = new Array(); 0 ?' X7 f6 Q: d# J4 a5 r5 L; q
L_Xpos = new Array();
; a; C' Z* z. a- RS_speed= new Array(); ^0 w/ [: A# y6 q+ p$ w+ K
L_speed= new Array();
& k/ ^5 A8 I0 F& `5 H7 m# T7 {5 kif (document.all) / y- u! u+ {5 X! L
{
( Y0 l5 m7 t: T2 F) Sfor (i = 0; i < S_amount; i++) " `5 u5 w/ \7 w
{ 6 w8 v9 l3 w2 I6 W5 |/ B
S_Ypos = Math.round(Math.random()*document.body.offsetHeight); 3 y/ W; U- H2 C: v/ @* G- U3 Q
S_Xpos = Math.round(Math.random()*document.body.offsetWidth);
1 M/ d& Q# @# B& `}
+ M/ O5 p5 h$ t; y9 w% T: K9 X1 Cfor (i = 0; i < L_amount; i++)
/ p! _8 H5 _ I{
- j7 x$ [9 Z6 m: }L_Ypos = Math.round(Math.random()*document.body.offsetHeight); 0 C7 r1 v H( I: C% `& j
L_Xpos = Math.round(Math.random()*document.body.offsetWidth); 9 }& \" r8 S: J. g5 q
} 2 N0 F+ x. m2 n" ~; S6 ?
document.write('<div id="Outer" style="position:absolute;top:0px;left:0px">'); ! ?" ~) T* i+ ~" K) o
document.write('<div id="Inner" style="position:relative">');
! z8 p/ h/ J3 tfor (i = 0; i < S_amount; i++)
( m' Y" Q2 x% c0 F5 W# W{document.write('<div id="ieS_star" style="position:absolute;top:'+S_Ypos+';left:'+S_Xpos+';width:1px;height:1px;background:#fffff0;font-size:1px"></div>');} + ?4 r1 E% s# E4 F' L2 F! i% P! R
for (i = 0; i < L_amount; i++) " v4 l2 d' R, U: r
{document.write('<div id="ieL_star" style="position:absolute;top:'+L_Ypos+';left:'+L_Xpos+';width:2px;height:2px;background:#ffffff;font-size:2px"></div>');} " d1 i, p' i9 }
document.write('</div>'); 3 A( ~8 h w% E
document.write('</div>'); 9 y5 n& z4 @6 v
for (i = 0; i < L_amount; i++)
6 @" B' B$ ]4 U* m. u& z{ - {0 k. u7 Q2 X2 ~) K- y( D& x
for (j = 0; j < cOlOuRs.length; j++)
% x- f# j# F/ [0 @. V9 r. |- a{var NewColour=Math.round(Math.random()*[j])}
) {0 Y3 i" A3 r8 x6 |" ~* Ydocument.all.ieS_star.style.background=cOlOuRs[NewColour];
2 a/ [5 F0 z4 ?document.all.ieL_star.style.background=cOlOuRs[NewColour];
& O1 W9 n1 `5 c* w} # _/ @- w2 u6 C' ~$ X
for (i=0; i < ieS_star.length; i++){S_speed=Math.random()*3+1} $ T$ x, v9 E$ }" u @4 T# w
for (i=0; i < ieL_star.length; i++){L_speed=Math.random()*7+2} ' ?( Q4 _8 |+ X
function ES_go()
. b' S* V# x- m2 w3 M{ ! r8 v7 H) e) V3 g* k) D
document.all.Outer.style.pixelTop=document.body.scrollTop; : P: h% x2 Q6 w+ T6 U& z ]9 @9 z
for (i=0; i < ieS_star.length; i++)
4 n. c/ a: {: B$ b/ D3 z e! L* g{ l/ u: [2 |/ `0 B: t
ieS_star.style.pixelLeft-=S_speed; 9 W2 w: U: U4 U) t+ h$ |2 U
if (ieS_star.style.pixelLeft < -10){ieS_star.style.pixelLeft=window.document.body.offsetWidth} ( s8 \+ a) G8 O* M" i: _1 G. a
}
" D2 d9 V5 X2 zS_timer=setTimeout('ES_go()',30); {3 a# R3 i1 y) a
} 7 n, x- W4 W0 H' `( n& d# J
function EL_go() . f' Q" ]! F: \
{ ) x5 A; X: H+ V( q2 _5 P
for (i=0; i < ieL_star.length; i++)
1 \, C( }6 J- s1 d0 K: T{
5 @( O: t/ x# O6 x. {ieL_star.style.pixelLeft-=L_speed;
8 y# N7 N1 z+ d1 A7 d W( Eif (ieL_star.style.pixelLeft < -10){ieL_star.style.pixelLeft=window.document.body.offsetWidth} 5 e3 d) ^0 G3 }, H8 L, O
} ) w" J, Z, j; Z( _# \
L_timer=setTimeout('EL_go()',10); C5 G; C% |( @; p* Q
}
8 c) h' ]2 ?, V+ k. e" B1 n5 s5 r6 Ufunction IeStart() 3 b* W. z( _6 c! ~$ I
{
# h7 Q% O9 Y, K% i' SES_go();
4 g' I9 O2 H5 L/ EEL_go();
9 T0 }. A6 f. w0 n, {5 M/ Q}
6 T3 q8 [' y& Z4 @6 x: yIeStart()
: m' N3 Q6 G/ }% z; I5 X. E}//End Explorer
; y \ y6 m: _; G2 G6 C& h! S: j( |% B! V2 y8 _
else if (document.layers) 7 V( G4 l# [$ S3 i* E% D# Q
{ 0 ]: N: V* X( x9 ^) v5 _& b
for (i = 0; i < S_amount; i++) ! H3 k7 n- T6 A7 ^4 D! w
{
: Q! k" c; L* _# Q; M+ b3 SS_Ypos = Math.round(Math.random()*window.innerHeight); , p$ \, r7 ~* F2 m* C6 f
S_Xpos = Math.round(Math.random()*window.innerWidth); 9 h j3 g' ~8 \% Z3 y+ [9 t7 F
document.write("<LAYER NAME='S_star"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>"); - q0 D& [; Y" |' c
document.layers["S_star"+i].top = S_Ypos; 6 Y, D# \7 S% {8 @5 I4 F. M
document.layers["S_star"+i].left = S_Xpos;
6 C, @$ y6 c" l5 t" D) k t} ! I8 B, l' j4 i+ j& { Z
for (i = 0; i < L_amount; i++)
* }4 S8 M( O2 y, v+ r4 Q: H4 y# V{
9 i! Q9 |: P/ @# G5 \$ ~5 XL_Ypos = Math.round(Math.random()*window.innerHeight); + @" V+ }1 a7 N
L_Xpos = Math.round(Math.random()*window.innerWidth); 1 \' R. W* X( v! o
document.write("<LAYER NAME='L_star"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,2,2'></LAYER>"); : P( }; y' Y7 b
document.layers["L_star"+i].top = L_Ypos;
z6 ?6 Z0 P9 Edocument.layers["L_star"+i].left = L_Xpos; ) j" N7 U" k3 G# \* H& v
for (j = 0; j < cOlOuRs.length; j++) - g0 g+ b: r: @" E5 {$ |0 U
{
6 h% U+ Z9 {7 K: qvar NewColour=Math.round(Math.random()*[j]);
; s* b$ X/ y# t& F" R} % d! Y: J, j. @& C. P# U; }
document.layers['S_star'+i].bgColor=cOlOuRs[NewColour]; 2 {$ O9 b" |4 c2 g4 ?3 n
document.layers['L_star'+i].bgColor=cOlOuRs[NewColour]; t0 n; B, p! y& l# }2 r: s- y
} 6 r4 D" ?1 g+ ?
for (i=0; i < S_amount; i++){S_speed=Math.random()*3+1} : b0 o& Z, P& F6 h; s1 u
for (i=0; i < L_amount; i++){L_speed=Math.random()*7+2} 2 ^/ _9 ]# V. a6 y" j- t
function NS_go() " a: R7 J. |+ p6 O- f' y- o2 ]
{
" O# D% o! Q9 d7 {for (i=0; i < S_amount; i++) / B: @$ \. o1 Y1 b/ C
{ ; O) k. e( F3 C7 {, ^! S$ `7 L
var temp="S_star"+i;//50 ; E3 ~+ }# v- ]6 i& F1 {; U& a
document.layers[temp].top=S_Ypos+window.pageYOffset; B8 q; }' } {
document.layers['S_star'+i].left-=S_speed;
" P1 k V) V K0 [ x* y$ g& `+ Dif (document.layers['S_star'+i].left < -10){document.layers['S_star'+i].left=window.innerWidth} $ X! E& B k7 s. ~
}
# e. [3 J) s; M% p0 B8 W/ ~S_timer=setTimeout('NS_go()',30); 1 w; T! t r: N y" h8 A
}
7 Z6 `8 @4 J$ D. U) Xfunction NL_go() " h: a1 ^' U1 W# l5 U4 H
{ 9 m9 x4 {) y; t: P2 t$ K
for (i=0; i < L_amount; i++)
: t1 _) N0 u3 n% \{ $ D5 R) z/ ~! D( Y
var temp="L_star"+i ) `, Q" t2 T5 x) n1 H
document.layers[temp].top=L_Ypos+window.pageYOffset;
r) m( t5 ^7 I. Z" @% s rdocument.layers['L_star'+i].left-=L_speed; & v! L& [; L: T; J- z) ^
if (document.layers['L_star'+i].left < -10){document.layers['L_star'+i].left=window.innerWidth} ( \- n) x0 [" S( I1 E$ A
}
4 E0 t, ~# `, j @# v5 X" D8 v; hL_timer=setTimeout('NL_go()',10);
# H, T4 g: ]5 W2 @" z. y" c% F2 _- }} , g9 C$ \7 C) m: J; U, c, v
function NsStart()
; Z3 c( s1 W* `( z{ 9 j2 U2 ~4 o) K7 t* J7 p) R
NS_go(); ; j' M9 R+ @) L0 x6 [
NL_go();
3 X* Z5 I: ^. ~! R}
1 a9 W; I, d1 u) pNsStart();
9 z3 R8 y5 r( q}//End Netscape 0 r' B- o) `& t! `
window.onresize = new Function("window.location.reload()");
) @; a: L' a6 w//--> 8 K @- A4 C- u( k# R0 @* H; [: ~
</script>
$ Y6 e4 o; Z; `& }' ~$ o! F }<------------ 插入控制码区段结束 ------------->
& [/ D9 J( E9 {) S/ V7 t; v
N" H" J. n$ G" Q. u8 d) F2 ^/ v7 u
二 复制到上段程式码后方任一位置
( A) o& K( ^8 u( T6 ^% I( j2 p. W2 l8 C7 Y" ~
<------------- 插入控制码区段开始 ------------>, V) s# T3 \) b0 X) _5 q1 {) M
* T, f4 W+ m( W& J0 b
<div style="position:relative"></div>
) m9 W1 |, z% [5 }& X: ~& A' F
, |4 S# T& n7 z' _8 R' j<------------- 插入控制码区段结束 ------------>
" H8 }) p. J, ^: I0 M4 y: [! b) b% d: \
|