http://jsfiddle.net/cD4Gr/1/Làm cách nào để sử dụng hoạt ảnh CSS để trượt phần tử vị trí cố định từ dưới cùng của trang lên trên cùng?
Đây là mã hoạt hình của tôi:
@-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;
}
hiện, div chỉ tự động bắt đầu ở phía trên, thay vì trượt lên trên cùng. điều duy nhất mà animates là opacity.