我怎么能让动画只播放5秒,然后它就消失了?
以下是来自码页的示例
@import "compass/css3";
@include keyframes(bounce) {
0%, 20%, 50%, 80%, 100% {
@include transform(translateY(0));
}
40% {
@include transform(translateY(-30px));
}
60% {
@include transform(translateY(-15px));
}
}
.arrow {
position: fixed;
bottom: 0;
left: 50%;
margin-left:-20px;
width: 40px;
height: 40px;
}
.bounce {
@include animation(bounce 2s infinite);
}发布于 2015-06-11 09:19:40
您只需调整css和动画:
@import "compass/css3";
@include keyframes(bounce) {
0%, 10%, 20%, 30%, 40%, 60%, 70%, 80% {
@include transform(translateY(0));
}
15%, 65% {
@include transform(translateY(-30px));
}
25%,75% {
@include transform(translateY(-15px));
}
80%{
opacity: 1;
}
100%{
opacity: 0;
}
0%{
opacity: 1;
}
}
body {
background: black;
}
.arrow {
position: fixed;
bottom: 0;
left: 50%;
margin-left:-20px;
width: 40px;
height: 40px;
opacity: 0;
}
.bounce {
@include animation(bounce 5s);
}在这里,代码笔http://codepen.io/anon/pen/gpRRVy
希望我能帮上忙
https://stackoverflow.com/questions/30776358
复制相似问题