CSS3----动画animation
来源:互联网 发布:拆分盘源码下载 编辑:程序博客网 时间:2024/06/06 01:04
Internet Explorer 10、Firefox 以及 Opera 支持 @keyframes 规则和 animation 属性。
Chrome 和 Safari 需要前缀 -webkit-
注释:Internet Explorer 9,以及更早的版本不支持
属性:
animation-timing-function:如示1
animation-fill-mode: 如示2
动画名:myfirst,全写
div{animation-name: myfirst;animation-duration: 5s;animation-timing-function: linear;animation-delay: 2s;animation-iteration-count: infinite;animation-direction: alternate;animation-play-state: running; -moz-animation-name: myfirst; /* Firefox */-moz-animation-duration: 5s;-moz-animation-timing-function: linear;-moz-animation-delay: 2s;-moz-animation-iteration-count: infinite;-moz-animation-direction: alternate;-moz-animation-play-state: running; -webkit-animation-name: myfirst; /* Safari 和 Chrome */-webkit-animation-duration: 5s;-webkit-animation-timing-function: linear;-webkit-animation-delay: 2s;-webkit-animation-iteration-count: infinite;-webkit-animation-direction: alternate;-webkit-animation-play-state: running;-o-animation-name: myfirst; /* Opera */-o-animation-duration: 5s;-o-animation-timing-function: linear;-o-animation-delay: 2s;-o-animation-iteration-count: infinite;-o-animation-direction: alternate;-o-animation-play-state: running;}
动画名:myfirst,简写
div{animation: myfirst 5s linear 2s infinite alternate;-moz-animation: myfirst 5s linear 2s infinite alternate; /* Firefox: */-webkit-animation: myfirst 5s linear 2s infinite alternate; /* Safari 和 Chrome: */-o-animation: myfirst 5s linear 2s infinite alternate; /* Opera: */}
@keyframes 创建规则
规定某项 CSS 样式,写法1: 注:可以按任一百分比(0%,25%,50%,75%,100%)
@keyframes myfirst{0% {background:red; left:0px; top:0px;}100% {background:blue; left:200px; top:200px;}}@-moz-keyframes myfirst /* Firefox */{0% {background:red; left:0px; top:0px;}100% {background:blue; left:200px; top:200px;}}@-webkit-keyframes myfirst /* Safari and Chrome */{0% {background:red; left:0px; top:0px;}100% {background:blue; left:200px; top:200px;}}@-o-keyframes myfirst /* Opera */{0% {background:red; left:0px; top:0px;}100% {background:blue; left:200px; top:200px;}}
规定某项 CSS 样式,写法2: 注:from - to 同等于0% -- 100%
@keyframes myfirst{from {background:red; left:0px; top:0px;}to {background:blue; left:200px; top:200px;}}@-moz-keyframes myfirst /* Firefox */{from {background:red; left:0px; top:0px;}to {background:blue; left:200px; top:200px;}}@-webkit-keyframes myfirst /* Safari and Chrome */{from {background:red; left:0px; top:0px;}to {background:blue; left:200px; top:200px;}}@-o-keyframes myfirst /* Opera */{from {background:red; left:0px; top:0px;}to {background:blue; left:200px; top:200px;}}
0 0
- CSS3 -webkit-animation(动画)
- CSS3 动画之animation
- CSS3之动画Animation
- css3的animation 动画
- css3 animation动画事件
- webkit-animation css3 动画
- CSS3动画 Animation
- css3 animation 动画应用
- CSS3----动画animation
- css3-animation动画
- css3的动画animation
- CSS3 Animation 帧动画
- CSS3 动画 Animation
- css3动画animation属性
- CSS3 Animation 动画
- css3动画-animation属性
- css3中的animation动画
- CSS3动画animation讲解
- AJAX的原理-如何做到异步和局部刷新
- MyEclipse10.X项目分类管理
- LABC and CABC-MTK Platform
- 屏幕效果设置中CABC功能介绍
- 【Android开发】之Fragment开发1
- CSS3----动画animation
- 数据结构学习15:线性表
- WebStorm 开发工具,js或html5开发的不二之选
- PopUpManager的createPopUp与addPopUp区别
- 响应式页面中的图片定位
- Android中Toast的用法简介
- 列表视图控件(List Control)
- java实现二叉树的构建以及3种遍历方法
- Oracle数据库中关于日期和时间字段类型