雪花飘落的JS代码

JavaScript014

雪花飘落的JS代码,第1张

N是管雪花的数量,Y是雪花下落的速度,(document.layers)?window.innerHeight:window.document.body.clientHeight是雪花下落的尺寸,可以改为=(document.layers)?window.innerHeight+100:window.document.body.clientHeight+100,下落尺寸加大100。

1、修改部分如下:

<html>

 <head>

  <script src="http://www.ren3.cn/Snow Demo/jsized.snow.min.js" type="text/javascript"></script>        

<script>

    /**

     * This function takes 2 arguments

     * First is the path to the directory with snowflake images

     * Second is the maximum number of snowflakes, please do not

     * set this number above 60 as it will impact the performance

     */

    createSnow("", 60)//目录改为当前目录

</script>

 </head>

 <body>

  测试

 </body>

</html>

2、在该网页目录 下 新添加 四张雪花图片 命名规则(snow0.gif snow1.gif snow2.gif snow3.gif)

...

this.el.onclick = a

this.parent.appendChild(this.el)

另外添加点击函数a()