css3动画特效:上下晃动的div

<div id="square" class="container animated">上下晃动</div>

/**
* transform-origin 设置旋转元素的基点位置
* animation-name 设置动画名称
* animation-duration 设置动画时间
* animation-fill-mode 设置播放后的状态
* animation-iteration-count 设置循环播放的次数
* transition-timing-function: cubic-bezier 贝塞尔曲线效果,它有四个值,指在X轴与Y轴的两个曲线的点,第一个点:X1 Y1;第二个点:X2 Y2
* transform: translate3d 设置动画Z轴位移几个元素,表示只在Z轴上移动
*
* 需要注意:transform: translate3d 不等于 transform: translateZ
*/ .animated {
animation-duration: 1s; /*动画时间*/
animation-fill-mode: both; /*播放后的状态*/
} .animated {
animation-iteration-count: infinite; /*动作循环的次数:infinite 无限循环*/
} .animated {
animation-duration: 2s; /*动画时间*/
} .container {
background: #2D97DB;
width: 90%;
height: 90%;
padding: 100px;
margin: 20px auto;
font-family: "微软雅黑";
font-size: 40px;
color: white;
text-align: center;
line-height: 90%;
} .container:hover{
animation-name:container; /*动画的名称*/
transform-origin: center bottom; /*设置动画旋转元素的基点为:居中靠下*/
cursor: pointer;
} @keyframes container{
0%,
100%,
20%,
50%,
80% {
transition-timing-function: cubic-bezier(0.215,.61,.355,1); /*贝塞尔曲线 : X1 Y1 X2 Y2*/
transform: translate3d(0,0,0); /*设置只在Z轴上移动*/
}
40%,
43%{
transition-timing-function: cubic-bezier(0.755,0.50,0.855,0.060);
transform: translate3d(0,-30px,0);
}
70%{
transition-timing-function: cubic-bezier(0.755,0.050,0.855,0.060);
transform: translate3d(0,-15px,0);
}
90%{
transform: translate3d(0,-4px,0);
}
}

最新文章

  1. Spring入门
  2. String和包装类Integer\Double\Long\Float\Character 都是final类型
  3. 数据库==&gt;&gt;数据查询基础
  4. eclipse ide for java ee developers 开发环境搭建(j2ee)
  5. centos复制到另外一台电脑连不上网
  6. 在Android项目中调用已有.so库
  7. Java序列化 如何把多个对象存储在一个文件中
  8. optimize table-2
  9. FLASK安装--兼收EZ_INSTALL及PIP
  10. Method to fix &quot;Naming information cannot be located because the target principal name is incorrect.&quot; for AD replication failure
  11. Intellj idea 安装JUnit
  12. Plugin execution not covered by lifecycle configuration的解决方案
  13. ML学习分享系列(2)_计算广告小窥[中]
  14. 1.2 PCI总线的信号定义
  15. Oracle表空间和表的常用操作指令
  16. weblogic中配置数据源
  17. 总结mysql的三种外键约束方式
  18. OLT、分光器、ONU直接的关系
  19. LinkedHashMap和HashTable
  20. 最小k度限制生成树

热门文章

  1. 关于Union 中 ORA-12704:字符集不匹配问题的解决
  2. Hiho coder 1236 2015 北京网络赛 Score
  3. 【译】Import Changes from Direct3D 11 to Direct3D 12
  4. 缓解 SQL Server has encountered 727 occurrence(s) of I/O requests taking longer than 15 seconds
  5. ftp发送文件
  6. JS弹出浮层
  7. 网易测试分享会——“一起打造你想要的QA团队”
  8. 【前端】制作一个handlebars的jQuery插件
  9. .dtsi .dts dtc dtb 是什么
  10. mysql主从配置(基于mysql5.5.x)