<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> second JavaScript put fireworks code exploded out of graphics </title>
<script type= "Text/javascript" >
var firework = function () {
This.size = 40;
This.speed = 0.1;
This.rise ();
}
Firework.prototype = {
Color:function () {
var c = [' 0 ', ' 3 ', ' 6 ', ' 9 ', ' C ', ' F '];
var t = [C[math.floor (Math.random () *100)%6], ' 0 ', ' f '];
T.sort (function () {return math.random () >0.5?-1:1;});
Return ' # ' +t.join (');
},
Aheight:function () {
var h = document.documentElement.clientHeight;
Return Math.Abs (Math.floor (Math.random () *h-200)) +201;
},
Firecracker:function () {
var B = document.createelement (' div ');
var w = document.body.clientWidth;
B.style.color = This.color ();
b.style.position = ' absolute ';
B.style.bottom = 0;
B.style.left = Math.floor (Math.random () *w) +1+ ' px ';
Document.body.appendChild (b);
return b;
},
Rise:function () {
var o = This.firecracker ();
var n = this.aheight ();
var speed = This.speed;
var e = this.expl;
var s = this.size;
var k = n;
var m = function () {
O.style.bottom = parsefloat (o.style.bottom) +k*speed+ ' px ';
K-=k*speed;
if (k<2) {
Clearinterval (Clear);
E (o,n,s,speed);
}
}
o.innerhtml = ' * ';
if (parseint (o.style.bottom) <n) {
var clear = setinterval (m,20);
}
},
Expl:function (o,n,s,speed) {
var R = N/3;
var Ri = N/6;
var r = 0;
var ri = 0;
for (Var i=0;i<s;i++) {
var span = document.createelement (' span ');
var p = document.createelement (' P ');
span.style.position = ' absolute ';
Span.style.left = 0;
span.style.top = 0;
span.innerhtml = ' * ';
p.style.position = ' absolute ';
P.style.left = 0;
p.style.top = 0;
p.innerhtml = ' + ';
O.appendchild (span);
O.appendchild (P);
}
function SPR () {
R + = R*speed;
ri+= RI*SPEED/2;
SP = O.getelementsbytagname (' span ');
p = o.getelementsbytagname (' P ');
for (var i=0; i<sp.length;i++) {
Sp[i].style.left=r*math.cos (360/s*i) + ' px ';
Sp[i].style.top=r*math.sin (360/s*i) + ' px ';
P[i].style.left=ri*math.cos (360/s*i) + ' px ';
P[i].style.top=ri*math.sin (360/s*i) + ' px ';
}
R-=r*speed;
if (r<2) {
Clearinterval (Cleari);
O.parentnode.removechild (o);
}
}
var Cleari = setinterval (spr,20);
}
}
Window.onload = function () {
function HappyNewYear () {
New Firework ();
}
SetInterval (happynewyear,400);
}
</script>
<style type= "Text/css" >
</style>
<body style= "background: #000; font:12px Arial" >
<div><a href= "http://www.999jiujiu.com/" >http://www.999jiujiu.com/</A></div>
</body>
The second JavaScript put fireworks code exploded out of graphics