animate.css动画库使用方法介绍
来源:互联网 发布:北京知天地 刘杰 电话 编辑:程序博客网 时间:2024/06/01 16:25
animate.css动画库简介
Animate.css是由Dan Eden的Daniel Eden使用CSS3的animation制作的动画效果的CSS集合。
它预设了抖动(shake)、闪烁(flash)、弹跳(bounce)、翻转(flip)、旋转(rotateIn/rotateOut)、淡入淡出(fadeIn/fadeOut)等多达 60 多种动画效果,几乎包含了所有常见的动画效果。换句话说:Animate.css就是一大堆的很酷,很有趣,而且很炫又能跨浏览器的动画效果样式集锦,可以直接使用到项目中。
animate.css动画库的浏览器兼容性
只兼容支持 CSS3 animate 属性的浏览器,他们分别是:IE10+、Firefox、Chrome、Opera、Safari。
使用方法
1、引入文件 animate.css动画库下载地址
<link rel="stylesheet" href="animate.min.css">//注:最好不要使用百度静态资源库的animate.css,可能版本没来得及更新部分功能无法使用。
2、HTML 及使用
<div class="animated bounce" id="hepai"></div>
给元素加上 class 后,刷新页面,就能看到动画效果了。animated 类似于全局变量,它定义了动画的持续时间;bounce 是动画具体的动画效果的名称,你可以选择任意的效果。
如果你要使用永续动画,可以在class中加上infinite(如果你用的是百度静态资源库的animate.css,这个好像就实现不了了);如:
<div class="animated bounce infinite" id="hepai"></div>
你也可以通过 JavaScript 或 jQuery 给元素添加这些 class,比如:
$(function(){ $('#hepai').addClass('animated bounce');});
有些动画效果最后会让元素不可见,比如淡出、向左滑动等等,可能你又需要将 class 删除,比如:
$(function(){ $('#hepai').addClass('animated bounce'); setTimeout(function(){ $('#dowebok').removeClass('bounce'); }, 1000);});
animate.css 的默认设置也许有些时候并不是我们想要的,所以你可以重新设置,比如:
#hepai { -webkit-animation-duration: 2s; -webkit-animation-delay: 1s; -webkit-animation-iteration-count: 2;}
animate.css动画形式参考
- animate.css动画库使用方法介绍
- Animate.css 动画库介绍
- animate.css CSS3动画库
- 强大而酷炫的CSS3动画库Animate.css使用方法
- Animate.css 基础使用方法
- CSS3动画库 —— Animate.css
- Animate.css动画库的使用
- VUE引用animate.css动画库
- 动画库animate.css的用法
- animate.css 动画制作
- css3动画简介以及动画库animate.css的使用
- css3动画简介以及动画库animate.css的使用
- css3动画简介以及动画库animate.css的使用
- css3动画简介以及动画库animate.css的使用
- css3动画简介以及动画库animate.css的使用
- css3动画简介以及动画库animate.css的使用
- css3动画简介以及动画库animate.css的使用
- css3动画简介以及动画库animate.css的使用
- Hibernate主键生成方式 Key Generator
- There is no getter for property "name" in java.lang.String
- Servlet 3.0 新特性详解
- Android Binder 设计与实现
- org.hibernate.HibernateException: /hibernate.cfg.xml not found
- animate.css动画库使用方法介绍
- Spark学习笔记#1-快速入门
- string.IsNullOrEmpty和string.IsNullOrWhiteSpace的区别
- 深度学习和自然语言处理的注意机制和记忆模型
- 类名.this与类名.class
- idea操作快捷键
- [暑假集训] jzoj 2016.7.13 noip模拟赛B 总结
- 116 - Unidirectional TSP
- java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder 异常