6
http://jsfiddle.net/cD4Gr/1/如何使用CSS動畫將固定位置元素從頁面底部滑動到頂部?
這是我的動畫代碼:
@-webkit-keyframes silde_to_top {
0% {
bottom: 0%;
top: default;
}
100% {
bottom: default;
top: 0%;
z-index: 1000000;
opacity: 0.5;
}
}
#test{
-webkit-animation-name: silde_to_top;
-webkit-animation-duration: 5s;
-webkit-animation-timing-function: ease;
-webkit-animation-iteration-count: 1;
-webkit-animation-direction: normal;
-webkit-animation-delay: 0;
-webkit-animation-play-state: running;
-webkit-animation-fill-mode: forwards;
}
目前,在div只是自動開始在頂部,而不是滑動到頂部。動畫是唯一不透明的東西。