css3中动画animation的应用
<!DOCTYPE html>
<html>
<head>
<style>
/*
@-webkit-keyframes anim1 { // 规定动画。
0% {
Opacity: 0;
font-size: 12px;
}
100% {
Opacity: 1;
font-size: 34px;
}
}
.anim1Div {
-webkit-animation-name: anim1 ; 规定 @keyframes 动画的名称
-webkit-animation-duration: 1.5s; 规定动画完成一个周期所花费的秒或毫秒。默认是 0
-webkit-animation-iteration-count: 400; 规定动画被播放的次数。默认是 1。
-webkit-animation-direction: alternate; 规定动画是否在下一周期逆向地播放。默认是 "normal"。
-webkit-animation-timing-function: ease-in-out; 规定动画的速度曲线。默认是 "ease"。
} */ div
{
width:100px;
height:100px;
background:red;
position:relative; animation:myfirst 5s linear 2s infinite alternate;
/* Firefox: */
-moz-animation:myfirst 5s linear 2s infinite alternate;
/* Safari and Chrome: */
-webkit-animation:myfirst 5s linear 2s infinite alternate;
/* Opera: */
-o-animation:myfirst 5s linear 2s infinite alternate;
} @keyframes myfirst /* 需要用@keyframes来申明动画的名称*/
{/*从0%一直到100%的渐变过程*/
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
} @-moz-keyframes myfirst /* Firefox */
{
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
} @-webkit-keyframes myfirst /* Safari and Chrome */
{
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
} @-o-keyframes myfirst /* Opera */
{
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
}
</style>
</head>
<body> <p><b>注释:</b>本例在 Internet Explorer 中无效。</p> <div></div> </body>
</html>
css3中动画animation的应用的更多相关文章
- css3中动画(transition)和过渡(animation)详析
		css3中动画(transition)和过渡(animation)详析 
- CSS3中动画属性transform、transition和animation
		Transform:变形 在网页设计中,CSS被习惯性的理解为擅长表现静态样式,动态的元素必须借助于javascript才可以实现,而CSS3的出现改变了这一思维方式.CSS3除了增加革命性的创新功能 ... 
- CSS3中动画属性transform、transition 和 animation
		CSS3中和动画有关的属性有三个 transform.transition 和 animation.下面来一一说明: transform 从字面来看transform的释义为改变,使 ... 
- CSS3(4)---动画(animation)
		CSS3(4)---动画(animation) 之前有写过过渡:CSS3(2)--- 过渡(transition) 个人理解两者不同点在于 过渡 只能指定属性的 开始值 与 结束值,然后在这两个属性值 ... 
- 怎样使CSS3中的animation动画当每滑到一屏时每次都运行
		这个得结合js来做的.比如这里有3个层,js判断滚动到当前层位置的时候给其加上一个class即可,而加的这个class就是带css3执行动画的 class <div id="a1&qu ... 
- CSS3中动画transform必须要了解的Skew变化原理
		transform是CSS3中比较安全的动画(对于性能来说),其中有一些动画属性,来执行不同的变化.今天我们来了解skew的变化原理. skew,其实使用的频率不是很高,当然也没有最低.但是往往,一直 ... 
- CSS3中的animation动画
		<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ... 
- 如何使CSS3中的animation动画当每滑到一屏时每次都运行
		这个我还没用过,但感觉以后会用到,就随手摘抄一下啦<div id="a1"></div> <div id="a2">< ... 
- css3中的animation
		不使用js或jquery,用css3实现一张图片的滑动.我用的是animation来设置所要应用的动画效果,首先在html中写好一个<div></div>,并放置一张图片在di ... 
随机推荐
- 使用float属性布局时父元素高度不能自适应的解决方法
			在网页的布局过程中,经常会用到float属性来实现页面的左右布局,但是有个问题就是父元素的高度并不能根据子元素的高度自适应.比如下面这段代码: <!DOCTYPE html> <ht ... 
- JSC学习笔记:JavaScriptCore 初识
			JSContext/JSValue JSContext是运行JavaScript的上下文环境,是一个全局环境实例:类似于浏览器端的window对象,表示浏览器的窗口:在浏览器中,所有JavaScrip ... 
- PBOC/EMV 中SDA和DDA简介
			PBOC/EMV里有两个非常重要的概念,SDA(static data authentication)和DDA(dynamic data authentication),分别叫做静态数据认证和动态数据 ... 
- 论山寨手机与Android联姻 【9】SmartPhone的硬件结构
			如何区别智能手机(SmartPhone)与功能手机(FeaturePhone)? 有一种观点认为,智能手机本质上是功能手机与便携式电脑(Laptop PC)的结合.功能手机的功能受限于制造厂商的预制, ... 
- php date操作
			date(format,timestamp) d - 月中的天 (01-31) m - 当前月,以数字计 (01-12) Y - 当前的年(四位数) h 小时,12 小时格式,有前导零 01 到 12 ... 
- poj1484---判断保险丝是否烧断
			题目输入要求: 2 2 10 //设备数n 接下来的操作数m 保险丝能承受最大电流c5 //电器1的电流7 //2的电流1 //反转开关12 //反转开关2 思路:设置一个flag数组,记得每次 ... 
- dhtmlgrid修改,支持IE10
			因为项目IE升级,导致原来使用的dhtmlgrid无法正常显示,同时通过loadxml接口还有属性不支持. 花了半天时间对dhtmlgrid进行了修改,能够支持IE10正常加载显示. edit by ... 
- 如何同时激活两个不同版本的MyEclipse 【MyEclipse2013和MyEclipse2014同时激活】
			激活一个MyEclipse的步骤,大家都会,在这里就不多说了,不会的可以看:http://jingyan.baidu.com/article/3ea51489cc14d452e71bba7a.html ... 
- 机顶盒加密系统流程 ECM EMM CW SK
			随着数字视频广播(DVB)的发展.观众将面对数字电视节目的选择多.广播业因为投资成本增加,这是需要收取费用的用户观看. 有条件接收系统(Conditional Access System).它的主要功 ... 
- jQuery模拟原生态App上拉刷新下拉加载
			jQuery模拟原生态App上拉刷新下拉加载效果代码,鼠标上拉时会显示loading字样,并且会模拟加载一条静态数据,支持触屏设备使用. <!doctype html> <html ... 
