amazeui学习笔记--css(常用组件15)--CSS动画Animation
amazeui学习笔记--css(常用组件15)--CSS动画Animation
一、总结
1、css3动画封装:CSS3 动画封装,浏览器需支持 CSS3 动画。
| Class | 描述 |
|---|---|
.am-animation-fade |
淡入 |
.am-animation-scale-up |
逐渐放大 |
.am-animation-scale-down |
逐渐缩小 |
.am-animation-slide-top |
顶部滑入 |
.am-animation-slide-bottom |
底部滑入 |
.am-animation-slide-left |
左侧滑入 |
.am-animation-slide-right |
右侧滑入 |
.am-animation-shake |
左右摇动 |
.am-animation-spin |
无限旋转 |
2、基本使用(这个好): <div class="am-animation-fade">...</div>
3、一直旋转的icon:<span class="am-icon-cog am-animation-spin"></span>
4、反向动画:添加 .am-animation-reverse class,让动画反向运行(通过把 animation-direction 设置为 reverse 实现)。
<div class="am-animation-fade am-animation-reverse">...</div> <span class="am-icon-cog am-animation-spin am-animation-reverse"></span>
5、动画延迟执行:添加以下 class 可以使动画延迟 1-6s 执行。
.am-animation-delay-1.am-animation-delay-2.am-animation-delay-3.am-animation-delay-4.am-animation-delay-5.am-animation-delay-6
自定义延时:
.my-animation-delay {
-webkit-animation-delay: 15s;
animation-delay: 15s;
}
<p><button type="button" class="am-btn am-btn-primary am-animation-delay-1">延迟 1s 执行</button></p>
二、CSS动画Animation
Animation
CSS3 动画封装,浏览器需支持 CSS3 动画。
| Class | 描述 |
|---|---|
.am-animation-fade |
淡入 |
.am-animation-scale-up |
逐渐放大 |
.am-animation-scale-down |
逐渐缩小 |
.am-animation-slide-top |
顶部滑入 |
.am-animation-slide-bottom |
底部滑入 |
.am-animation-slide-left |
左侧滑入 |
.am-animation-slide-right |
右侧滑入 |
.am-animation-shake |
左右摇动 |
.am-animation-spin |
无限旋转 |
使用演示
点击按钮查看动画效果。
默认效果
<div class="am-animation-fade">...</div>
<span class="am-icon-cog am-animation-spin"></span>
反向动画
添加 .am-animation-reverse class,让动画反向运行(通过把 animation-direction 设置为 reverse 实现)。
<div class="am-animation-fade am-animation-reverse">...</div>
<span class="am-icon-cog am-animation-spin am-animation-reverse"></span>
动画延迟执行
添加以下 class 可以使动画延迟 1-6s 执行。
.am-animation-delay-1.am-animation-delay-2.am-animation-delay-3.am-animation-delay-4.am-animation-delay-5.am-animation-delay-6
自定义延时:
.my-animation-delay {
-webkit-animation-delay: 15s;
animation-delay: 15s;
}
没延迟的动画
延迟 1s 执行
延迟 2s 执行
延迟 3s 执行
延迟 4s 执行
延迟 5s 执行
延迟 6s 执行
<button id="animation-start" type="button" class="am-btn am-btn-danger">点击开始执行动画</button>
<hr/>
<div id="animation-group">
<p><button type="button" class="am-btn am-btn-primary">没延迟的动画</button></p>
<p><button type="button" class="am-btn am-btn-primary am-animation-delay-1">延迟 1s 执行</button></p>
<p><button type="button" class="am-btn am-btn-secondary am-animation-delay-2">延迟 2s 执行</button></p>
<p><button type="button" class="am-btn am-btn-success am-animation-delay-3">延迟 3s 执行</button></p>
<p><button type="button" class="am-btn am-btn-warning am-animation-delay-4">延迟 4s 执行</button></p>
<p><button type="button" class="am-btn am-btn-danger am-animation-delay-5">延迟 5s 执行</button></p>
<p><button type="button" class="am-btn am-btn-primary am-animation-delay-6">延迟 6s 执行</button></p>
</div>
<script>
$(function() {
var $btns = $('#animation-group').find('.am-btn');
var dfds = [];
var animating = false;
var animation = 'am-animation-scale-up';
$('#animation-start').on('click', function() {
if (!animating) {
animating = true;
$btns.each(function() {
var dfd = new $.Deferred();
dfds.push(dfd);
var $this = $(this);
if ($.AMUI.support.animation) {
$this.addClass(animation).one($.AMUI.support.animation.end, function() {
$this.removeClass(animation);
dfd.resolve();
});
}
});
$.when.apply(null, dfds).done(function() {
animating = false;
console.log('[AMUI] - 所有动画执行完成');
dfds = [];
});
}
});
});
</script>
参考资源
amazeui学习笔记--css(常用组件15)--CSS动画Animation的更多相关文章
- amazeui学习笔记--css(常用组件13)--进度条Progress
amazeui学习笔记--css(常用组件13)--进度条Progress 一.总结 1.进度条基本使用:进度条组件,.am-progress 为容器,.am-progress-bar 为进度显示信息 ...
- amazeui学习笔记--css(常用组件5)--评论列表Comment
amazeui学习笔记--css(常用组件5)--评论列表Comment 一.总结 1.am-comment:使用am-comment来声明评论对象,这个是放在article里面的,虽然article ...
- amazeui学习笔记--css(常用组件16)--文章页Article
amazeui学习笔记--css(常用组件16)--文章页Article 一.总结 1.基本使用:文章内容页的排版样式,包括标题.文章元信息.分隔线等样式. .am-article 文章内容容器 .a ...
- amazeui学习笔记--css(常用组件14)--缩略图Thumbnail
amazeui学习笔记--css(常用组件14)--缩略图Thumbnail 一.总结 1.基本样式:在 <img> 添加 .am-thumbnail 类:也可以在 <img> ...
- amazeui学习笔记--css(常用组件12)--面板Panel
amazeui学习笔记--css(常用组件12)--面板Panel 一.总结 1.面板基本样式:默认的 .am-panel 提供基本的阴影和边距,默认边框添加 .am-panel-default,内容 ...
- amazeui学习笔记--css(常用组件11)--分页Pagination
amazeui学习笔记--css(常用组件11)--分页Pagination 一.总结 1.分页使用:还是ul包li的形式: 分页组件,<ul> / <ol> 添加 .am-p ...
- amazeui学习笔记--css(常用组件10)--导航条Topbar
amazeui学习笔记--css(常用组件10)--导航条Topbar 一.总结 1. 导航条:就是页面最顶端的导航条:在容器上添加 .am-topbar class,然后按照示例组织所需内容.< ...
- amazeui学习笔记--css(常用组件9)--导航nav
amazeui学习笔记--css(常用组件9)--导航nav 一.总结 1.导航基本使用:<ul> 添加 .am-nav class 以后就是一个基本的垂直导航.默认样式中并没有限定导航的 ...
- amazeui学习笔记--css(常用组件8)--列表list
amazeui学习笔记--css(常用组件8)--列表list 一.总结 1.链接列表:就是多个链接在一起组成的列表, 使用 <ul> 结构嵌套链接列表,添加 .am-list.还是ui包 ...
随机推荐
- 【APP测试】APP弱网环境测试
方法一:利用抓包工具 1.利用fiddler通过代理连接上手机之后,进入Fiddler->Rules->Customize Rules,点击弹出的CustomRules.js文件,找到m_ ...
- cz.msebera.android.httpclient.conn.ConnectTimeoutException: Connect to /192.168.23.1:8080 timed out(Android访问后台一直说链接超时)
明明之前还是可以运行的练习,过段时间却运行不了,一直说访问后台超时, 对于这个问题我整整弄了两天加一个晚上,心酸...,上网找了很多但是都解决不了,我就差没有砸电脑了. 首先 : 第一步:Androi ...
- RvmTranslator6.0 - AVEVA Marine Hull Model
eryar@163.com 1. Introduction RvmTranslator can translate the RVM file exported by AVEVA Plant(PDMS) ...
- Unix/Linux环境C编程新手教程(37) shell经常使用命令演练
cat命令 cat命令能够用来查看文件内容. cat [參数] 文件名称. grep-指定文件里搜索指定字符内容. Linux的文件夹或文件. -path '字串' 查找路径名匹配所给字串的全部 ...
- vue --- watch 高级用法
假设有如下代码: <div> <p>FullName: {{fullName}}</p> <p>FirstName: <input type=&q ...
- 小项目: low版本的 员工信息程序:
### 附加两个文件1 user_info 和worker_info flag = False def logon(): #登录函数 global flag usr = input('Username ...
- Impala SQL
不多说,直接上干货! 其实,跟hive差不多,大家可以去参考我写的hive学习概念系列. Impala SQL VS HiveQL 下面是Impala对基础数据类型和扩展数据类型的支持 • 此外,Im ...
- vue中 v-cloak 的用法
原文来自:http://www.sunzhongwei.com/hide-vuejs-variable-with-v-cloak-when-page-loading
- ps---报告当前系统的进程状态
ps aux最初用到Unix Style中,而ps -ef被用在System V Style中,两者输出略有不同.现在的大部分Linux系统都是可以同时使用这两种方式的. linux上进程有5种状态: ...
- 洛谷 P1801 黑匣子_NOI导刊2010提高(06)(未完)
P1801 黑匣子_NOI导刊2010提高(06) 题目描述 Black Box是一种原始的数据库.它可以储存一个整数数组,还有一个特别的变量i.最开始的时候Black Box是空的.而i等于0.这个 ...