⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 21.htm

📁 介绍了javascript的常用的函数
💻 HTM
字号:
<html>
<head>
<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='snow.gif' 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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -