html+css+js好看的梅花
来源:互联网 发布:华尔街英语软件课程 编辑:程序博客网 时间:2024/04/30 21:31
html+css+js好看的梅花
meihua.html:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>CSS3+JS梅花飘落 - 何问起</title>
<!--<base target="_blank">-->
<base href="." target="_blank">
<link href="./files/leaves.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="hewenqi">
<div class="pauseHovertree hovertreerun"> </div>
</div>
<script src="./files/hovertreemeihua.js"></script>
<div class="leave" style="top: 30px; right: 33px; animation-name: fade, drop; animation-delay: 0.385104s, 0.385104s; animation-duration: 8.67578s, 8.67578s;">
<img src="./files/2.png" style="animation-name: clockwiseSpin; animation-duration: 4.83808s;">
</div>
<div class="leave" style="top: 30px; right: 46px; animation-name: fade, drop; animation-delay: 3.37827s, 3.37827s; animation-duration: 5.03104s, 5.03104s;">
<img src="./files/3.png" style="animation-name: counterclockwiseSpinAndFlip; animation-duration: 6.23133s;">
</div>
<div class="leave" style="top: 30px; right: 27px; animation-name: fade, drop; animation-delay: 4.86905s, 4.86905s; animation-duration: 7.2992s, 7.2992s;">
<img src="./files/3.png" style="animation-name: clockwiseSpin; animation-duration: 4.91787s;">
</div>
<div class="leave" style="top: 30px; right: 25px; animation-name: fade, drop; animation-delay: 4.17076s, 4.17076s; animation-duration: 8.57357s, 8.57357s;">
<img src="./files/1.png" style="animation-name: clockwiseSpin; animation-duration: 6.10835s;">
</div>
<div class="leave" style="top: 30px; right: 17px; animation-name: fade, drop; animation-delay: 1.51625s, 1.51625s; animation-duration: 7.73051s, 7.73051s;">
<img src="./files/2.png" style="animation-name: counterclockwiseSpinAndFlip; animation-duration: 7.16054s;">
</div>
</body>
</html>
leaves.css:
/**
* Leaves v0.2
* By HoverTree, http://hovertree.com, http://weibo.com/hovertree, 2012/12/15
*/
~(function(doc) {
var FallingLeaves = function(num, id) {
this.body = doc.body;
this.support = false;
this.container = id ? doc.getElementById(id) : this.body;
// this.container = id ? doc.getElementById('id') : this.body;
this.num = num ? num : 5;
this.init()
};
FallingLeaves.prototype = {
init: function() {
this.supportNot();
if (this.support != false) {
for (var i = 0; i < this.num; i++) {
this.container.appendChild(this.createLeaf())
}
}
},
supportNot: function() {
var domPrefixes = 'Webkit Moz O ms a'.split(' ');
for (var i = 0; i < domPrefixes.length; i++) {
if (this.container.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
this.support = domPrefixes[i];
break
}
if (domPrefixes[i] == "a") {
if (this.container.style.animationName !== undefined) {
this.support = domPrefixes[i];
break
}
}
}
},
randomInteger: function(low, high) {
return low + Math.floor(Math.random() * (high - low))
},
randomFloat: function(low, high) {
return low + Math.random() * (high - low)
},
pixelValue: function(value) {
return value + 'px'
},
durationValue: function(value) {
return value + 's'
},
createLeaf: function() {
var self = this,
leafDiv = doc.createElement('div'),
image = doc.createElement('img'),
spinAnimationName = (Math.random() < 0.5) ? 'clockwiseSpin' : 'counterclockwiseSpinAndFlip',
fadeAndDropDuration = self.durationValue(self.randomFloat(5, 11)),
spinDuration = self.durationValue(self.randomFloat(4, 8)),
leafDelay = self.durationValue(self.randomFloat(0, 5));
leafDiv.className = "leave";
image.src = "http://hover"+"tree.com/texiao/js/22/htimg/" + self.randomInteger(1, self.num) + '.png';
leafDiv.style.top = self.pixelValue(30);
leafDiv.style.right = self.pixelValue(self.randomInteger(0, 50));
if (self.container.style[self.support + 'AnimationName'] !== undefined) {
image.style[self.support + 'AnimationName'] = spinAnimationName;
image.style[self.support + 'AnimationDuration'] = spinDuration;
leafDiv.style[self.support + 'AnimationName'] = 'fade, drop';
leafDiv.style[self.support + 'AnimationDelay'] = leafDelay + ', ' + leafDelay;
leafDiv.style[self.support + 'AnimationDuration'] = fadeAndDropDuration + ', ' + fadeAndDropDuration
}
if (this.support == "a") {
image.style.animationName = spinAnimationName;
image.style.animationDuration = spinDuration;
leafDiv.style.animationName = 'fade, drop';
leafDiv.style.animationDelay = leafDelay + ', ' + leafDelay;
leafDiv.style.animationDuration = fadeAndDropDuration + ', ' + fadeAndDropDuration
}
leafDiv.appendChild(image);
return leafDiv
}
};
new FallingLeaves();
})(document);
1.png
2.png
3.png
- html+css+js好看的梅花
- 实用好看的CSS+JS+table 导航
- html / CSS 自定义字体 自己设置好看的特效字体
- 好看的CSS按钮
- 好看的table css样式
- 一好看的CSS样式
- 好看的table css样式
- 梅花雨的js日历控件
- 一个好看的 html css table表格 ,单双行半色
- 好看的JS脚本案例
- div对话框,js+div+css实现好看的提示框效果
- 几个比较好看的Button的CSS
- 纯CSS实现的好看的边框
- css 比较好看的一个table样式
- 四个好看的CSS样式表格
- 几个好看的css按钮样式
- 四个好看的CSS样式表格
- 四个好看的CSS样式表格
- wordpress和微信平台那些事
- Java中的this和super
- ViewGroup的touch事件:dispatchTouchEvent、onInterceptTouchEvent、onTouchEvent
- 412. Fizz Buzz
- UVA.11464 Even Parity (思维题 开关问题)
- html+css+js好看的梅花
- mysql 查看慢查询
- Linux的一些命令
- [LeetCode]344. Reverse String(反转字符串)
- Hibernate连接三种数据库的配置(SQL Server、Oracle、MySQL)
- Java网络
- DataBinding
- Activity的事件处理:dispatchTouchEvent,onUserInteraction,onTouchEvent
- 输入输出缓冲区