网页制作 
首页 > 网页制作 > 浏览文章

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

(编辑:jimmy 日期: 2024/11/15 浏览:3 次 )

复制代码代码如下:
<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="/UploadFiles/2021-03-30/rainyday.js"><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="/UploadFiles/2021-03-30/8390.jpg"><div id="cholder">
<canvas id="canvas"></canvas>
</div>
</body>
</html>
上一篇:分享全球十款超强HTML5开发工具
下一篇:HTML 5 input placeholder 属性如何完美兼任ie