最新下载
24小时阅读排行榜
- 1 javascript如何创建与操作节点?【教程】
- 2 c++中functor仿函数是什么_c++函数对象用法【进阶】
- 3 mysql并发更新同一行数据怎么办_mysql冲突解决思路
- 4 javascript在哪里运行_如何设置开发环境【教程】
- 5 javascript事件循环是什么_宏任务和微任务如何执行【教程】
- 6 行锁和表锁有什么区别_mysql锁机制解析
- 7 XSLT 3.0的新特性在数据映射中的应用
- 8 如何给XML文件添加数字签名 C#实现XML签名
- 9 XML Catalog是什么 如何用它来解析本地DTD/XSD文件
- 10 PowerShell如何监控文件系统事件并调用API上传XML
- 11 如何用javascript实现本地存储【教程】
- 12 css 动画与 transform-origin_自定义动画的旋转轴心
- 13 如何使用Golang构建微服务API网关_Golang微服务API管理实践
- 14 mysql中HAVING子句与WHERE子句的区别
- 15 mysql中LIMIT与OFFSET的分页查询语法
最新教程
-
- Node.js 教程
- 16105 2025-08-28
-
- CSS3 教程
- 1546511 2025-08-27
-
- Rust 教程
- 23244 2025-08-27
-
- Vue 教程
- 25712 2025-08-22
-
- PostgreSQL 教程
- 22196 2025-08-21
-
- Git 教程
- 9183 2025-08-21
jQuery雪花缓慢飘落图标特效是一款html5雪花字体制作下雪天缓缓飘落各种雪花图标特效。
var fa = false;
//more layers and css blur will cause performance drop
var layer2 = new Layer(16, 6);
setInterval(layer2.addIcon, 150);
var layer1 = new Layer(32, 4);
setInterval(layer1.addIcon, 300);
function Layer(fontSize, speed){
this.addIcon = function(){
var random_icon = icons[Math.floor(Math.random()*icons.length)];
$random_x = Math.floor((Math.random() * 600) + 1);
if(fa){
var $icon = $('<i style="font-size:' + fontSize + 'px;" class="fa ' + random_icon + '" aria-hidden="true"></i>').appendTo(".scene");
}else{
var $icon = $('<i style="font-size:' + fontSize + 'px;" class="fa fa-snowflake-o" aria-hidden="true"></i>').appendTo(".scene");
}
//initial position
TweenLite.to($icon, 0, {x: $random_x, color: "#2222ff", y: -80});
//main animation
TweenLite.to($icon, speed, {color: "#ff00ff", y: 600, x: $random_x + (Math.random() * 400), opacity: 0, ease:Linear.easeNone, onComplete: deleteIcon, onCompleteParams: ["{self}"]});
//rotate animation
var rotation_speed = (Math.random() + 10);
TweenMax.to($icon, rotation_speed, {rotation: 390, ease:Linear.easeNone, repeat: -1});
};
