google-chrome - 进度条标记动画在 Chrome 中不起作用
问题描述
我正在为我的进度条使用 slideIn 动画。它可以在 Firefox 中正常工作,但不知何故它在 Chrome 中停止工作。
我在 HTML 中使用的进度标签是:
<progress class="progress-slideIn"
style="height: 6px;
/* animation trigger */
/* ignored in IE 11 */
--animation-delay: {{ loop.index**1.5 / 3.4 }}s;
/* hide animated bar */
overflow: hidden;
/* remove progress styling */
-webkit-appearance: none;
appearance: none;
" value="20" max="50">
ProgressBar</progress>
在 CSS 中,我为特定浏览器(Chrome 和 Firefox)贴了一个动画和样式类,并为它们两个都设置了一个关键帧:
.progress-slideIn::-webkit-progress-value {
animation: 2s progress-slideIn;
/* inherit delay per element */
animation-delay: var(--animation-delay);
/* initial state */
transform: translateX(-100%);
/* keep final state */
animation-fill-mode: forwards;
}
.progress-slideIn::-moz-progress-bar {
animation: 2s progress-slideIn;
/* inherit delay per element */
animation-delay: var(--animation-delay);
/* initial state */
transform: translateX(-100%);
/* keep final state */
animation-fill-mode: forwards;
}
@keyframes progress-slideIn {
100% {
transform: translateX(0);
}
}
解决方案
推荐阅读
- python - 删除字符串python中的行
- c# - 在 XAML 中创建的对象不能由 cs 中的 x:Name 调用
- javascript - 如何在nidejs的while循环中等待函数完全执行
- ssl - 如何找出为什么 openssl 不起作用,但 netcat 起作用?
- angular - undefined 不是对象(评估 'r.urlTree')
- javascript - 在 Express Router (node.js) 中使用 for 循环
- mysql - ORDER BY id DESC 结合 WHERE id < ... 不会使用索引
- reactjs - TS2339 - 无法映射来自 API 的请求
- amazon-web-services - emr 5.27 上的 zeppelin 8.1 在 S3 上保存笔记本无法更改 STORAGE 值
- mysql - 基于 SQL 的 FP-Growth 算法