-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (52 loc) · 1.49 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/JQuery-Snowfall/1.7.4/snowfall.jquery.min.js"></script>
<title>Document</title>
<style>
#content {
width: 800px;
height: 400px;
background-color: burlywood;
margin: 0 auto;
position: relative;
}
</style>
</head>
<body>
<div id="content">
</div>
<script>
// 飘雪特效
// 该插件的参数有:
// flakeCount|number 雪花数量
// flakeColor|#RGB 雪花颜色
// minSize|number 雪花最小体积
// maxSize|number 雪花最大体积
// minSpeed|number 雪花最小速度
// maxSpeed|number 雪花最大速度
// round:boolean true雪花圆形|false方形(笑哭)
// shadow:boolean true雪花有阴影|false无阴影
// image:url 雪花图片
$(document).ready(function () {
$("#content").mouseenter(function () {
$("#content").snowfall({
flakeCount: 30,
image: "./flake.png",
minSize: 10,
maxSize: 32,
minSpeed:.1,
maxSpeed:1
});
})
$("#content").mouseleave(function () {
$("#content").snowfall("clear");
});
})
</script>
</body>
</html>