CSS主页面中怎么加雪花飘落效果代码

网页特效|Linkweb.cn/Js|---页面漫天飞雪
CSS主页面中怎么加雪花飘落效果代码
<html>
<head>
<title>网页特效|Linkweb.cn/Js|---页面漫天飞雪</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#000000" onLoad="snow()">
<script language="JavaScript">
<!--
N = 40;
Y = new Array();
X = new Array();
S = new Array();
A = new Array();
B = new Array();
M = new Array();
V = (document.layers)?1:0;
iH=(document.layers)?window.innerHeight:window.document.body.clientHeight;
iW=(document.layers)?window.innerWidth:window.document.body.clientWidth;
for (i=0; i < N; i++){
Y[i]=Math.round(Math.random()*iH);
X[i]=Math.round(Math.random()*iW);
S[i]=Math.round(Math.random()*5+2);
A[i]=0;
B[i]=Math.random()*0.1+0.1;
M[i]=Math.round(Math.random()*1+1);
}
if (V){
for (i = 0; i < N; i++)
{document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,"+M[i]+","+M[i]+"'></LAYER>")}
}
else{
document.write('<div style="position:absolute;top:0px;left:0px">');
document.write('<div style="position:relative">');
for (i = 0; i < N; i++)
{document.write('<div id="si" style="position:absolute;top:0;left:0;width:'+M[i]+';height:'+M[i]+';background:#fffff0;font-size:'+M[i]+'"></div>')}
document.write('</div></div>');
}
function snow(){
var H=(document.layers)?window.innerHeight:window.document.body.clientHeight;
var W=(document.layers)?window.innerWidth:window.document.body.clientWidth;
var T=(document.layers)?window.pageYOffset:document.body.scrollTop;
var L=(document.layers)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < N; i++){
sy=S[i]*Math.sin(90*Math.PI/180);
sx=S[i]*Math.cos(A[i]);
Y[i]+=sy;
X[i]+=sx;
if (Y[i] > H){
Y[i]=-10;
X[i]=Math.round(Math.random()*W);
M[i]=Math.round(Math.random()*1+1);
S[i]=Math.round(Math.random()*5+2);
}
if (V){document.layers['sn'+i].left=X[i];document.layers['sn'+i].top=Y[i]+T}
else{si[i].style.pixelLeft=X[i];si[i].style.pixelTop=Y[i]+T}
A[i]+=B[i];
}
setTimeout('snow()',10);
}
//-->
</script>
<script language="Javascript">
<!--
function selectAll(theField){
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
}
//-->
</script>
</table>
</body>2011-06-01
mengvlog 阅读 11 次 更新于 2025-07-21 05:10:38 我来答关注问题0
  • 夜空背景背景色彩过渡,营造夜晚雪花飘落的氛围,通过`background-image: radial-gradient`等CSS属性实现。雪花样式模拟自然界雪花形态,通过不同HTML元素展示,大小、明暗和移动轨迹随机变化,力求真实。粒子飞升效果使用`transform: rotate(180deg);`辅助,模拟地面粒子向上的动态效果,增加视觉体验。HTML完整源...

  •  ssylm 点击百度知道用户名有些人的博克很漂亮,

    ②.背景和模块分开运动 进入CSS代码把开头的body{}里面加入;background-image:url(图片地址);background-repeat: no-repeat;background-position: center;background-attachment: fixed ③.百度空间的各模块背景透明 进入CSS自定义中,然后按住Ctrl+f找到.modbox 然后把括号里的内容替换成“modbox{padding:10px 10px...

  • http://imgfree.21cn.com/free/flash/64.swf浅蓝色的雪花在空中,小雪花降落 http://imgfree.21cn.com/free/flash/65.swf飘落的空心小兰圈 http://imgfree.21cn.com/free/flash/66.swf一只手的图形 http://imgfree.21cn.com/free/flash/67.swf由远而近飞来的流星 http://imgfree.21cn.com/free/flash/...

  •  samboys 如何做QQ空间的会变换的flash图片啊?

    http://imgfree.21cn.com/free/flash/130.swf鼠标滑过,雪花飘飘 http://imgfree.21cn.com/free/flash/131.swf绿色的枫叶飘落http://imgfree.21cn.com/free/flash/132.swf鼠标滑过、圆球线条变形 还有很多自己可以去找一下.. 鼠标代码:

檬味博客在线解答立即免费咨询

CSS相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部