標籤:
偷懶使用animate.css來製作效果
animate動畫的基本屬性:
| 屬性 |
描述 |
CSS |
| @keyframes |
規定動畫。 |
3 |
| animation |
所有動畫屬性的簡寫屬性,除了 animation-play-state 屬性。 |
3 |
| animation-name |
規定 @keyframes 動畫的名稱。 |
3 |
| animation-duration |
規定動畫完成一個周期所花費的秒或毫秒。預設是 0。 |
3 |
| animation-timing-function |
規定動畫的速度曲線。預設是 "ease"。 |
3 |
| animation-delay |
規定動畫何時開始。預設是 0。 |
3 |
| animation-iteration-count |
規定動畫被播放的次數。預設是 1。 |
3 |
| animation-direction |
規定動畫是否在下一周期逆向地播放。預設是 "normal"。 |
3 |
| animation-play-state |
規定動畫是否正在運行或暫停。預設是 "running"。 |
3 |
| animation-fill-mode |
規定對象動畫時間之外的狀態。 |
3 |
下面的兩個例子設定了所有動畫屬性:
div{animation: myfirst 5s linear 2s infinite alternate;/* Firefox: */-moz-animation: myfirst 5s linear 2s infinite alternate;/* Safari 和 Chrome: */-webkit-animation: myfirst 5s linear 2s infinite alternate;/* Opera: */-o-animation: myfirst 5s linear 2s infinite alternate;}
@keyframes myfirst
{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:200px; top:200px;}
75% {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
@-moz-keyframes myfirst /* Firefox */
{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:200px; top:200px;}
75% {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
@-webkit-keyframes myfirst /* Safari and Chrome */
{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:200px; top:200px;}
75% {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
@-o-keyframes myfirst /* Opera */
{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:200px; top:200px;}
75% {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
animate
#slide_one i:nth-child(1) { opacity: 0;}#slide_one.z-in i:nth-child(1) { opacity: 1; -webkit-backface-visibility: hidden; animation:bounceInRight 1s both ; -webkit-animation: bounceInRight 1s both ;}
translate
.chart div:nth-child(1) span{display: block;height: 0px;background: #b94c02;-webkit-transition: all .5s linear 2s;transition: all .5s linear 2s;-webkit-backface-visibility: hidden;}.z-current .chart div:nth-child(1) span{height: 120px;}
animation-fill-mode:none | forwards | backwards | both [ , none | forwards | backwards | both ]*
none:預設值。不設定對象動畫之外的狀態
forwards:設定對象狀態為動畫結束時的狀態
backwards:設定對象狀態為動畫開始時的狀態
both:設定對象狀態為動畫結束或開始的狀態
animation-fill-mode:both
動畫開始時為opacity:0;opacity:1;
http://css.doyoe.com/
CSS3動畫整理