<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<script>
var snowflake = new Array();
snowflake[snowflake.length] ='http://case.blueidea.cn/files/2008/04/25/work_291488_5798_20080425_143101_7932129_t.jpg';
snowflake[snowflake.length] ='http://case.blueidea.cn/files/2008/04/24/work_337487_5774_20080424_220535_1005249_t.jpg';
snowflake[snowflake.length] ='http://case.blueidea.cn/files/2008/04/25/work_249203_5777_20080425_011719_8349305_t.jpg';
snowflake[snowflake.length] ='http://case.blueidea.cn/files/2008/04/24/work_9565_5754_20080424_000113_9539795_t.png';
var no = 8 ;//同期显示图片数
var speed=100;//下降速度
var oTime = new Date();
var lastTime = oTime.getTime();
var x_sin, x_point, y_point;
var x_length, x_increased, y_increased;
var i, body_width = 932, body_height = 538;
var lastTime = 0;
var fallInterval = 2.4;
x_sin = new Array();
x_point = new Array();
y_point = new Array();
x_length = new Array();
x_increased = new Array();
y_increased = new Array();
var oBody = document.body;
var d=document;
/**/body_width = oBody.clientWidth;
body_height = oBody.clientHeight;
for (i = 0; i < no; ++ i) {
snowFlakeImgNo = Math.round(Math.random()*(snowflake.length-1));
x_sin[i] = 0;
x_point[i] = Math.random()*(body_width-250)+100;
y_point[i] = Math.random()*body_height;
x_length[i] = Math.random()*20;
// x_increased[i] = 0.02 + Math.random()/10;
// y_increased[i] = 0.7 + Math.random();
x_increased[i] = 0.08 + Math.random()/5;
y_increased[i] = 2.7 + Math.random()*2;
d.write("<div id=\"snowFlakeDiv_"+ i +"\" style=\"position:absolute; z-index:11; visibility:visible; top: 15px; left: 215px;\"><img src=\"" + snowflake[snowFlakeImgNo] + "\" border=\"0\" id='snowImg_"+ i +"'></div>");
}
function snowFlakeFloat() {
var now = new Date();
var second = now.getTime();
var scrollTop = document.body.scrollTop;
for (i = 0; i < no; i++) {
if (y_point[i] >= 0) {
y_point[i] += y_increased[i];
}
if (y_point[i] > scrollTop + body_height - 10 || y_point[i] < scrollTop || y_point[i] < 0) { // 移出窗口,或在等待队列
if ((second - lastTime) / 1000 > fallInterval) { // 从队列中下落
snowFlakeImgNo = Math.round(Math.random()*(snowflake.length-1));
if (document.getElementById('snowImg_'+i)) {
document.getElementById('snowImg_'+i).src = snowflake[snowFlakeImgNo];
}
x_point[i] = Math.random()*(body_width-x_length[i]-250) + 100;
y_point[i] = scrollTop;
x_increased[i] = 0.05 + Math.random()/2;
y_increased[i] = 2.7 + Math.random()/2;
// x_increased[i] = 0.05;
// y_increased[i] = 2.7;
body_width = oBody.clientWidth;
body_height = oBody.clientHeight;
lastTime = second;
}else {
y_point[i] = -50;
}
}
x_sin[i] += x_increased[i];
document.getElementById("snowflakeDiv_"+i).style.pixelTop = y_point[i];
document.getElementById("snowflakeDiv_"+i).style.pixelLeft = x_point[i] + x_length[i]*Math.sin(x_sin[i]);
}
}
window.setInterval("snowFlakeFloat()",speed);
</script>
</body>
</html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<script>
var snowflake = new Array();
snowflake[snowflake.length] ='http://case.blueidea.cn/files/2008/04/25/work_291488_5798_20080425_143101_7932129_t.jpg';
snowflake[snowflake.length] ='http://case.blueidea.cn/files/2008/04/24/work_337487_5774_20080424_220535_1005249_t.jpg';
snowflake[snowflake.length] ='http://case.blueidea.cn/files/2008/04/25/work_249203_5777_20080425_011719_8349305_t.jpg';
snowflake[snowflake.length] ='http://case.blueidea.cn/files/2008/04/24/work_9565_5754_20080424_000113_9539795_t.png';
var no = 8 ;//同期显示图片数
var speed=100;//下降速度
var oTime = new Date();
var lastTime = oTime.getTime();
var x_sin, x_point, y_point;
var x_length, x_increased, y_increased;
var i, body_width = 932, body_height = 538;
var lastTime = 0;
var fallInterval = 2.4;
x_sin = new Array();
x_point = new Array();
y_point = new Array();
x_length = new Array();
x_increased = new Array();
y_increased = new Array();
var oBody = document.body;
var d=document;
/**/body_width = oBody.clientWidth;
body_height = oBody.clientHeight;
for (i = 0; i < no; ++ i) {
snowFlakeImgNo = Math.round(Math.random()*(snowflake.length-1));
x_sin[i] = 0;
x_point[i] = Math.random()*(body_width-250)+100;
y_point[i] = Math.random()*body_height;
x_length[i] = Math.random()*20;
// x_increased[i] = 0.02 + Math.random()/10;
// y_increased[i] = 0.7 + Math.random();
x_increased[i] = 0.08 + Math.random()/5;
y_increased[i] = 2.7 + Math.random()*2;
d.write("<div id=\"snowFlakeDiv_"+ i +"\" style=\"position:absolute; z-index:11; visibility:visible; top: 15px; left: 215px;\"><img src=\"" + snowflake[snowFlakeImgNo] + "\" border=\"0\" id='snowImg_"+ i +"'></div>");
}
function snowFlakeFloat() {
var now = new Date();
var second = now.getTime();
var scrollTop = document.body.scrollTop;
for (i = 0; i < no; i++) {
if (y_point[i] >= 0) {
y_point[i] += y_increased[i];
}
if (y_point[i] > scrollTop + body_height - 10 || y_point[i] < scrollTop || y_point[i] < 0) { // 移出窗口,或在等待队列
if ((second - lastTime) / 1000 > fallInterval) { // 从队列中下落
snowFlakeImgNo = Math.round(Math.random()*(snowflake.length-1));
if (document.getElementById('snowImg_'+i)) {
document.getElementById('snowImg_'+i).src = snowflake[snowFlakeImgNo];
}
x_point[i] = Math.random()*(body_width-x_length[i]-250) + 100;
y_point[i] = scrollTop;
x_increased[i] = 0.05 + Math.random()/2;
y_increased[i] = 2.7 + Math.random()/2;
// x_increased[i] = 0.05;
// y_increased[i] = 2.7;
body_width = oBody.clientWidth;
body_height = oBody.clientHeight;
lastTime = second;
}else {
y_point[i] = -50;
}
}
x_sin[i] += x_increased[i];
document.getElementById("snowflakeDiv_"+i).style.pixelTop = y_point[i];
document.getElementById("snowflakeDiv_"+i).style.pixelLeft = x_point[i] + x_length[i]*Math.sin(x_sin[i]);
}
}
window.setInterval("snowFlakeFloat()",speed);
</script>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货