HTML下雪代码

HTML下雪代码,第1张

<html>

<head>

</head>

<BODY bgcolor="#000000">

<SCRIPT language=JavaScript1.2>

var snowsrc="images/xuehua1.gif"

var no = 10

var ns4up = (document.layers) ? 1 : 0// browser sniffer

var ie4up = (document.all) ? 1 : 0

var dx, xp, yp// coordinate and position variables

var am, stx, sty// amplitude and step variables

var i, doc_width = 800, doc_height =600

if (ns4up) {

doc_width = self.innerWidth

doc_height = self.innerHeight

} else if (ie4up) {

doc_width = document.body.clientWidth

doc_height = document.body.clientHeight

}

dx = new Array()

xp = new Array()

yp = new Array()

am = new Array()

stx = new Array()

sty = new Array()

for (i = 0i <no++ i) {

dx[i] = 0// set coordinate variables

xp[i] = Math.random()*(doc_width-50)// set position variables

yp[i] = Math.random()*doc_height

am[i] = Math.random()*20// set amplitude variables

stx[i] = 0.02 + Math.random()/10// set step variables

sty[i] = 0.7 + Math.random()// set step variables

if (ns4up) { // set layers

if (i == 0) {

document.write("<layer name=\"dot"+ i +"\" left=\"50\" top=\"50\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"></a></layer>")

} else {

document.write("<layer name=\"dot"+ i +"\" left=\"50\" top=\"50\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"></layer>")

}

} else if (ie4up) {

if (i == 0) {

document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absoluteZ-INDEX: "+ i +"VISIBILITY: visibleTOP: 15pxLEFT: 15px\"><img src='"+snowsrc+"' border=\"0\"></a></div>")

} else {

document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absoluteZ-INDEX: "+ i +"VISIBILITY: visibleTOP: 15pxLEFT: 15px\"><img src='"+snowsrc+"' border=\"0\"></div>")

}

}

}

function snowNS() { // Netscape main animation function

for (i = 0i <no++ i) { // iterate for every dot

yp[i] += sty[i]

if (yp[i] >doc_height-50) {

xp[i] = Math.random()*(doc_width-am[i]-30)

yp[i] = 0

stx[i] = 0.02 + Math.random()/10

sty[i] = 0.7 + Math.random()

doc_width = self.innerWidth

doc_height = self.innerHeight

}

dx[i] += stx[i]

document.layers["dot"+i].top = yp[i]

document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i])

}

setTimeout("snowNS()", 10)

}

function snowIE() { // IE main animation function

for (i = 0i <no++ i) { // iterate for every dot

yp[i] += sty[i]

if (yp[i] >doc_height-50) {

xp[i] = Math.random()*(doc_width-am[i]-30)

yp[i] = 0

stx[i] = 0.02 + Math.random()/10

sty[i] = 0.7 + Math.random()

doc_width = document.body.clientWidth

doc_height = document.body.clientHeight

}

dx[i] += stx[i]

document.all["dot"+i].style.pixelTop = yp[i]

document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i])

}

setTimeout("snowIE()", 10)

}

if (ns4up) {

snowNS()

} else if (ie4up) {

snowIE()

}

</SCRIPT>

</body>

</html>

记得给我加分啊

var snowsrc="images/xuehua1.gif"这句是你雪花图片的地址

先把代码贴出来

1、小雪花代码

<div data-widget-config=”{‘duration’:0.1,’activeTriggerCls’:’.tshop-psm-shop-ww-hover’,'interval’:0.1,’effect’:'scrollx’,'activeIndex’:1,’navCls’:'user-crazyshej2′,’contentCls’:'user-crazysj1′,’autoplay’:true}” data-widget-type=”Carousel” style=”position:relative”><ul style=”display:none”><li style=”width:475pxheight:800pxdisplay:blockfloat:left”></li></ul><ul><li style=”width:475pxheight:800pxright:50%margin-right:485px”><embed allowscriptaccess=”never” flashvars=”scene=taobao_shop” height=”1000〃 src=”http://img1.tbcdn.cn/tfscom/T1lmk2Fk8bXXXtxVjX.swf” type=”application/x-shockwave-flash” width=”475〃 wmode=”transparent”></embed></li></ul></div><div data-widget-config=”{‘duration’:0.1,’activeTriggerCls’:’.tshop-psm-shop-ww-hover’,'interval’:0.1,’effect’:'scrollx’,'activeIndex’:1,’navCls’:'user-crazyshej2′,’contentCls’:'user-crazysj1′,’autoplay’:true}” data-widget-type=”Carousel” style=”position:relativez-index:10000000”><ul style=”display:none”><li style=”width:475pxheight:800pxdisplay:blockfloat:left”></li></ul><ul><li style=”width:475pxheight:800pxleft:50%margin-left:485px”><embed allowscriptaccess=”never” flashvars=”scene=taobao_shop” height=”1000〃 src=”http://img1.tbcdn.cn/tfscom/T1lmk2Fk8bXXXtxVjX.swf” type=”application/x-shockwave-flash” width=”475〃 wmode=”transparent”></embed></li></ul></div>

2、大雪花代码

<div data-widget-config=”{‘duration’:0.1,’activeTriggerCls’:’.tshop-psm-shop-ww-hover’,'interval’:0.1,’effect’:'scrollx’,'activeIndex’:1,’navCls’:'user-crazy2′,’contentCls’:'user-crazysj1′,’autoplay’:true}” data-widget-type=”Carousel” style=”position:relative”><ul style=”display:none”><li style=”width:475pxheight:800pxdisplay:blockfloat:left”></li></ul><ul><li style=”width:475pxheight:800pxright:50%margin-right:485px”><embed allowscriptaccess=”never” flashvars=”scene=taobao_shop” height=”1000〃 src=”http://img2.tbcdn.cn/tfscom/T1svNgFBxdXXXtxVjX.swf” type=”application/x-shockwave-flash” width=”475〃 wmode=”transparent”></embed></li></ul></div><div data-widget-config=”{‘duration’:0.1,’activeTriggerCls’:’.tshop-psm-shop-ww-hover’,'interval’:0.1,’effect’:'scrollx’,'activeIndex’:1,’navCls’:'user-crazy2′,’contentCls’:'user-crazysj1′,’autoplay’:true}” data-widget-type=”Carousel” style=”position:relativez-index:10000000”><ul style=”display:none”><li style=”width:475pxheight:800pxdisplay:blockfloat:left”></li></ul><ul><li style=”width:475pxheight:800pxleft:50%margin-left:485px”><embed allowscriptaccess=”never” flashvars=”scene=taobao_shop” height=”1000〃 src=”http://img2.tbcdn.cn/tfscom/T1svNgFBxdXXXtxVjX.swf” type=”application/x-shockwave-flash” width=”475〃 wmode=”transparent”></embed></li></ul></div>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7258783.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-03
下一篇 2023-04-03

发表评论

登录后才能评论

评论列表(0条)

保存