我想實現堆疊進度條的動畫,其中第一個將加載,然後第二個從第一個加載完成。這是我的CSS。每個狀態欄都是一個div,所有div都以一個大格子返回。任何想法我錯過了什麼?它不會從0到從右到左逐個加載進度條。 感謝您的閱讀css動畫狀態欄不能從0加載到它的值
.terra-ProgressGroup {
flex: auto;
display: flex;
background: #d3d4d5;
flex-direction: row;
border-radius: 0.5em;
overflow: auto;
animation-delay: 3s;
}
.terra-ProgressGroup div {
transform: translateX(-100%);
animation: loadbar 3s forwards;
-webkit-animation: loadbar 3s forwards;
opacity: 0;
}
@keyframes loadbar {
0% {
opacity: 1;
}
100% {
transform: translateX(0);
opacity: 1;
}
}
.terra-ProgressGroup--progress {
// flex: 1 1 auto;
border-radius: 0em;
padding-right: 1px;
animation-delay: 3s;
// background-color: #ffffff;
}
.terra-ProgressGroup--progress:not(:first-child){
// background-color: #ffffff;
// padding-right: 1px;
}
渲染HTML:
<div><h1 class="u-pb--lg text-bold">Grouped ProgressBar Component Examples</h1><div class="space"><div> Example: User earning all the points</div><div class="terra-ProgressGroup"><!-- react-text: 94 --> <!-- /react-text --><div class="well-background--concept1 terra-ProgressGroup--progress" style="width: 10%; height: 50px;"></div><div class="well-background--concept2 terra-ProgressGroup--progress" style="width: 20%; height: 50px;"></div><div class="well-background--concept3 terra-ProgressGroup--progress" style="width: 40%; height: 50px;"></div><div class="well-background--concept4 terra-ProgressGroup--progress" style="width: 10%; height: 50px;"></div><div class="well-background--concept5 terra-ProgressGroup--progress" style="width: 10%; height: 50px;"></div><div class="well-background--concept6 terra-ProgressGroup--progress" style="width: 10%; height: 50px;"></div><!-- react-text: 101 --> <!-- /react-text --></div></div><div><div> Example: User earning 600 of 1000 points(50/150/300/100)</div><div class="terra-ProgressGroup"><!-- react-text: 105 --> <!-- /react-text --><div class="well-background--concept1 terra-ProgressGroup--progress" style="width: 5%; height: 50px;"></div><div class="well-background--concept2 terra-ProgressGroup--progress" style="width: 15%; height: 50px;"></div><div class="well-background--concept3 terra-ProgressGroup--progress" style="width: 30%; height: 50px;"></div><div class="well-background--concept4 terra-ProgressGroup--progress" style="width: 10%; height: 50px;"></div><!-- react-text: 110 --> <!-- /react-text --></div></div></div>
請提供您的'HTML',如果可能,鏈接到您的運行代碼。 –
@AndyHoffman我正在使用一個反應組件。請檢查更新後的問題。創建一個div數組並將其傳遞給大格 – User7354632781
爲什麼不選擇一個解決方案來解決前一個問題?看起來你正在使用我給你的解決方案中的代碼。此外,您應該只發布呈現的HTML,您更有可能以這種方式獲得解決方案。只需帶上你的應用程序並複製開發工具中的html,以便我們有一個工作演示。 –