最新下载
js左侧边导航菜鼠标悬停展开二级菜单导航
24小时阅读排行榜
- 1 Javascript如何操作历史记录_如何管理浏览器历史?
- 2 javascript链表如何实现_如何操作节点的数据
- 3 如何优化Golang内存使用_使用Slice复用和对象池减少内存分配
- 4 SVG中的<foreignObject>标签怎么用 嵌入HTML内容
- 5 c++如何用perf工具分析性能 c++ Linux性能剖析【教程】
- 6 如何在不停机情况下备份_mysql热备方案
- 7 css初级项目结构写好了样式不好看怎么办_逐步优化边距和配色
- 8 mysql迁移后时间字段异常怎么办_mysql时间兼容问题
- 9 css相对定位后元素无法覆盖其他元素怎么办_调整z-index实现覆盖
- 10 如何在Golang中优化协程调度_提高任务执行并行度
- 11 怎么用Go语言的encoding/xml包处理XML
- 12 Python如何处理自闭合标签 <tag/> 的解析
- 13 c++如何实现代理模式 c++设计模式之Proxy【实例】
- 14 如何用Python解析PubMed的XML数据
- 15 如何在mysql中限制查询条数_mysql limit用法解析
最新教程
-
- Node.js 教程
- 14475 2025-08-28
-
- CSS3 教程
- 1541588 2025-08-27
-
- Rust 教程
- 22156 2025-08-27
-
- Vue 教程
- 24643 2025-08-22
-
- PostgreSQL 教程
- 21329 2025-08-21
-
- Git 教程
- 8427 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});
};
