Index.js
*,
*: After,
*: Before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
Box-sizing: border-box;
}
. Clearfix:after {
Visibility: hidden;
Display: block;
Font-size: 0;
Content: "";
Clear: both;
Height: 0;
}
. Clearfix {
*zoom: 1;
}
. FL {
Float: left;
}
. fr {
Float: right;
}
. FL,
. fr {
_display: inline;
}
. Top-banner {
Position: absolute;
Z-index: 999;
Left: 0;
Top: 0;
Height: + px;
Line-height: + px;
Padding: 0 px;
Width: %;
Font-size: px;
Background-color: rgba(255, 255, 255, 0.15 );
Color: #fff;
}
. Top-banner a {
Color: #fff;
Text-decoration: none;
}
Index.html
<! DOCTYPE html>
<html lang= "ZH-CN">
<head>
<meta charset="Utf-8" >
<title>rainy day– realistic raindrop effect </title>
<style media="screen" >
body {
overflow: hidden;
height: %;
margin: 0;
padding: 0;
}
img {
width: %;
height: %;
}
</style>
<link rel= "stylesheet" href= "Css/index.css">
<script src= "js/rainyday.js"></script>
<script>
function Run() {
var image = document.getElementById (' background ');
image. onload = function () {
var engine = new Rainyday ({
image: This
});
engine.rain ([[3, 2, 2]], + );
};
image.crossorigin = ' anonymous ';
image. src = ' http://i.imgur.com/U1Tqqdw.jpg ';
}
</Script>
</head>
<body onload="run ();" >
<img id= "background" alt= "background" src= "" />
</body>
<div style=< Span class= "S5" > "Position:fixed;bottom:< Span class= "S10" >30px;width:100 %;height:90px ;z-index:999 ">
<div class= "Footer-banner" style= "width:728px; margin:0 Auto "></div>
</div>
>
Achieve the effect of raindrops