欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2023-11-13 08:00:21
雨滴特效想必大家都有见到过吧,而本文所要介绍的这个特效是借助HTML5实现的,晶莹剔透,感兴趣的朋友可以尝试运行下... 14-05-14...

复制代码
代码如下:

<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>