javascript - Background image SVG animation stopped working on chrome
问题描述
Not sure when or how, but the loading svg animation i was using is no longer working on Chrome (still works on safari and firefox for example).
Here's a code sample for the problem
<svg width='64px' height='64px' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-default"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(0 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(36 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.1s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(72 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.2s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(108 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.3s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(144 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.4s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(180 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.5s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(216 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.6s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(252 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.7s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(288 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.8s' repeatCount='indefinite'/></rect><rect x='46' y='35' width='8' height='30' rx='5' ry='5' fill='#666666' transform='rotate(324 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='0.9s' repeatCount='indefinite'/></rect></svg>
Anyone has any idea on how to fix this?
解决方案
update your chrome to the latest version(v68) and it should work.
推荐阅读
- flutter - 在 TextField 中包装文本而不创建换行符
- html - HTML Flex 布局在 Internet Explorer 中看起来不同
- typescript - AWS CDK - 如何将多个 http 方法添加到同一资源
- java - jwt 令牌实际上是如何在 jwt.io 网站中创建的?
- php - 如何通过单词(键)匹配而不是 PHP 中的索引号获取 XML 值?
- bigcommerce - stencil 中访问请求的 URL 参数
- python - 我如何显示分类变量的数据框,如“目的”
- javascript - xml2js - 错误:键 $ 不能以 '$' 开头
- android - Flutter Image Picker 不会从相册/图库中选择图像
- javascript - 如何在我的节点应用程序中使用 if else 语句和表达验证器进行评估