最简单的jquery.ripples水面涟漪效果

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
* {
margin: 0;
padding: 0;
}
html {

height: 100%;

}
body{
background: url(header-background.jpg) no-repeat;
background-size: cover;
height:100%;
}
</style>
<body >

</body>
<script src="../js/jquery-2.1.4.min.js"></script>
<script src="js/jquery.ripples-min.js"></script>
<script>
/* https://github.com/sirxemic/jquery.ripples */
$(document).ready(function() {
try {
$('body').ripples({
resolution: 512,
dropRadius: 20, //px
perturbance: 0.04,
});
}
catch (e) {
$('.error').show().text(e);
}
});
</script>
</html>