HTML5实现晶莹剔透的雨滴特效
HTML5实现晶莹剔透的雨滴特效
发布时间:2016-12-27 来源:查字典编辑
摘要:HTML5雨滴特效img{display:none;}body{overflow:hidden;}#canvas{position:abso...

<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="http://www.jb51.netjscss/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="http://www.jb51.netjscss/demoimg/201401/8390.jpg" />

<div id="cholder">

<canvas id="canvas"></canvas>

</div>

</body>

</html>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新HTML5教程学习
热门HTML5教程学习
网页设计子分类