HTML5如何实现晶莹剔透的雨滴特效

仅有尝试过,努力过,坚持过,才能有收获。一分耕耘,一分收获,仅有努力了,才能绽放出成功的花朵。只要功夫深,铁杵磨成针。我相信,只要我朝着这个梦想努力奋斗,坚持不懈,那么,我就必须会成功!
复制代码
代码如下:

<html>
<head>
<title>HTML5雨滴特效</title>
<style media="screen" type="text/css">
img { display: none; }
body { overflow: hidden; }
#canvas { position: absolute; top: 0px; left: 0px; }
</style>
<script src="/jscss/demoimg/201401/rainyday.js" type="text/javascript"></script>
<script type="text/javascript">
function demo() {
var engine = new RainyDay('canvas','demo1', window.innerWidth, window.innerHeight);
engine.gravity = engine.GRAVITY_NON_LINEAR;
engine.trail = engine.TRAIL_DROPS;
engine.rain([
engine.preset(0, 2, 500)
]);
engine.rain([
engine.preset(3, 3, 0.88),
engine.preset(5, 5, 0.9),
engine.preset(6, 2, 1),
], 100);
}
</script>
</head>
<body onload="demo();">
<img id="demo1" src="/jscss/demoimg/201401/8390.jpg" />
<div id="cholder">
<canvas id="canvas"></canvas>
</div>
</body>
</html>

到此这篇关于HTML5如何实现晶莹剔透的雨滴特效就介绍到这了。人在世上,恩一定要报,仇可以不报,因为因果自有循环,但帮你的人一定要让他有回报。更多相关HTML5如何实现晶莹剔透的雨滴特效内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!

标签: