一下是从w3c上面考下来了的,

animation:[[ animation-name ] || [ animation-duration ] || [ animation-timing-function ] || [ animation-delay ] || [ animation-iteration-count ] || [ animation-direction ]] [ , [ animation-name ] || [ animation-duration ] || [ animation-timing-function ] || [ animation-delay ] || [ animation-iteration-count ] || [ animation-direction ]]*

独立属性

[ animation-name ]:检索或设置对象所应用的动画名称

[ animation-duration ]:检索或设置对象动画的持续时间

[ animation-timing-function ]:检索或设置对象动画的过渡类型

[ animation-delay ]:检索或设置对象动画延迟的时间

[ animation-iteration-count ]:检索或设置对象动画的循环次数

[ animation-direction ]:检索或设置对象动画在循环中是否反向运动

[ animation-play-state ]:检索或设置对象动画的状态。 

一下是代码部分:写的比较简单,也没有考虑浏览器兼容问题了  

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title>vertical-align</title>
</head>
<style>
.wap{width:200px;height:200px;background:red;}
.move{animation:move 3s ease 0s infinite alternate;}
@keyframes move{
0%{opacity:0;transform:rotate(0deg);}
50%{opacity:0.5;transform:rotate(90deg);}
100%{opacity:1;transform:rotate(180deg);}
}

</style>
<body>
<div class="wap move" onclick="run()"></div>

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
var flag = true; //用作标志
function run(){
if(flag==true){
$('.move').css('animation-play-state','paused'); //设置动画状态--暂停
flag = false;
}else{
$('.move').css('animation-play-state','running');//设置动画状态--开始
flag = true;
}
}
</script>
</body>

最新文章

  1. HTML5学习笔记之History API
  2. Win7下安装配置gVim
  3. 利用sourcemap来调试sass
  4. Shopping(SPFA+DFS HDU3768)
  5. Ext.Loader
  6. Python使用UUID库生成唯一ID(转)
  7. DOM文档对象总结
  8. ActiveX,ATL和COM技术
  9. 固定cell.imageView.image的大小
  10. yum简介(转)
  11. CODE[VS]-数的计算-递推-天梯白银
  12. checkValidity-表达验证方法。
  13. 如何继承Date对象?由一道题彻底弄懂JS继承。
  14. python基础(常用内容)
  15. Mysql 统一设置utf8字符
  16. 初探linux子系统集之led子系统(一)
  17. Filebeat 启动关闭流程
  18. Eclipse:报错Failed to read artifact descriptor for org.springframework.boot:spring-boot-autoconfigure:jar:2.1.2.
  19. .net中 登录 才能下载文件的方法 Response.WriteFile实现下载
  20. js 图片转换base64 base64转换为file对象

热门文章

  1. UVaLive 6625 Diagrams &amp; Tableaux (状压DP 或者 DFS暴力)
  2. 回顾JDBC
  3. 基础数据结构 之 栈(python实现)
  4. Codeforces Gym 100513F F. Ilya Muromets 线段树
  5. HashMap解决hash冲突的方法
  6. androidstudio构建(或导入)工程(不用gradle)
  7. Missing access checks in put_user/get_user kernel API (CVE-2013-6282)
  8. Android 4.1源码编译找不到资源文件解决办法
  9. Java log code example
  10. js获取网络图片的宽和高