粒子动画Particleground.js

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="UTF-8">
 5         <title></title>
 6         <style type="text/css">
 7         body{
 8                 background: #000000;
 9                 position: relative;
10             }
11             #demo{
12                 width: 922px;
13                 height: 550px;
14                 background:url(img/merry-christmas.jpg);
15                 margin: auto;
16                 
17             }
18             #demo2{
19                 width: 100%;
20                 height: 100%;
21             }
22         </style>
23     </head>
24     <body>
25         <div id="demo"></div>
26         <div id="demo2"></div>
27         <script type="text/javascript" src="Particleground.js-master/production/particleground.js"></script>
28         <script type="text/javascript" src="Particleground.js-master/production/snow.js"></script>
29         <script type="text/javascript" src="Particleground.js-master/production/particle.js"></script>
30         <script type="text/javascript">
31             new Particleground.snow( '#demo' );
32             new Particleground.particle( '#demo2', {
33                 // range等于0,表示不连线
34                 range: 0,
35                 max: 20,
36                 num: 18,
37                 speed: 3
38             });
39         </script>
40     </body>
41 </html>
原文地址:https://www.cnblogs.com/jessical626/p/5978542.html