如何在Chrome中制作关键帧动画
<button class="loading">btn</button>
@keyframes animation_loading {
from { background-position:0 0; }
to { background-position:25px 0; }
}
@-webkit-keyframes animation_loading {
from { background-position:0 0; }
to { background-position:25px 0; }
}
button.loading {
background-image:url(//www.dynaccount.com/button.bg-loading.png);
animation:animation_loading 0.5s linear infinite;
}
答案 0 :(得分:2)
“如何在Chrome中制作关键帧动画”
您需要在animation
属性中添加-webkit
前缀:
button.loading {
background-image:url(//www.dynaccount.com/button.bg-loading.png);
-moz-animation: animation_loading 0.5s linear infinite; /* FF 15 & below */
-webkit-animation: animation_loading 0.5s linear infinite;
animation: animation_loading 0.5s linear infinite;
}