我在用着
#progressBar{
background-color: #247BA0;
width: 150px;
padding: 10px;
border-radius: 5px;
animation: progressBar 3s ease;
animation-fill-mode:both;
text-align: center;
box-sizing: content-box;
}
Run Code Online (Sandbox Code Playgroud)
和
@keyframes progressBar {
0% { width: 0; }
100% { width: 280px; }
}
Run Code Online (Sandbox Code Playgroud)
我想改变@keyframe使用JS变量的宽度数。我怎样才能做到这一点(没有 jQuery)?