<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>满天飞舞的雪花</title>
</head>
<body bgcolor="#000000">
<script language="javascript">
var num = 15;
x = new Array();
y = new Array();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
for (i = 0; i < num; i++) {
x[i] = Math.random()*(doc_width-30)+10;
y[i] = Math.random()*doc_height;
str = "<img src='../assets/img/coupon_ico.png' style='position:absolute;";
str += "top:" + y[i] + ";left:" + x[i] + "'id='dot" + i + "'>";
document.write(str);
}
function snow(){
for (i = 0; i < num; i++){
x[i]+=Math.random()*3;
x[i]-=Math.random()*3;
y[i]++;
if(y[i]>doc_height)y[i] = -20;
document.all["dot"+i].style.pixelTop = y[i];
document.all["dot"+i].style.pixelLeft = x[i];
}
setTimeout("snow()",10);
}
snow();
</script>
</body>
</html>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…