當您看到小提琴時,您會看到動畫以某種方式跳動。 它應該從左到右到100%寬度,然後在右側擠壓回0%寬度。如何解決這個問題?CSS3關鍵幀進度條
div:after {
content: "";
height: 3px;
background: red;
position: absolute;
animation: loader 2s;
-webkit-animation: loader 2s;
animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
transition-timing-function: linear;
-webkit-transition-timing-function: linear;
bottom: 0px;
margin-left: 0;
}
@keyframes loader {
0% {left: 0px;}
99% { left: 100%;}
}
@-webkit-keyframes loader {
0% {width: 0%;left:0;}
50% { width: 100%;}
99% { width: 0%;right:0;}
}
很好的解決方案呢! – Mike 2015-04-02 15:21:01