グループ化されたプログレスバーにアニメーションを追加しようとしています。各プログレスバーは0からその値にロードされます。たとえば私のサンプルコードでは、最初に赤のプログレスバーをロードしてから、緑色のプログレスバーをロードします。どうやってやるの?複数のプログレスバーアニメーションで各プログレスバーを0からその値にロードします
this jsfiddleでコードを確認してください。
HTML:
は<div class="progress-bar-outer">
<div class="progress-bar-inner">
</div>
<div class="progress-bar-inner2">
</div>
</div>
CSS:
.progress-bar-outer {
width: 300px;
height: 40px;
flex: auto;
display: flex;
flex-direction: row;
border-radius: 0.5em;
overflow: hidden;
background-color: gray;
}
.progress-bar-inner {
/* You can change the `width` to change the amount of progress. */
width: 75%;
height: 100%;
background-color: red;
}
.progress-bar-inner2 {
/* You can change the `width` to change the amount of progress. */
width: 50%;
height: 100%;
background-color: green;
}
.progress-bar-outer div {
animation:loadbar 3s;
-webkit-animation:loadbar 3s;
}
@keyframes loadbar {
0% {width: 0%;left:0;right:0}
}
はあなたがそれをしたい場所あなたが私の答えで見ることができるように開始するように緑色のバーを取得できるようになります... https://でのstackoverflow。 com/a/45148563/2720927 –