扫码关注官方订阅号
光阴似箭催人老,日月如移越少年。
如果只是单纯的改变宽度,少年可以这样实现
<svg> <rect x='20' y='20' width='250' height='250' fill='blue'> <animate animateType="css" attributeName="width" values="250;0;250" dur="3s" repeatCount="indefinite"/> </rect> </svg>
给animate添加id后,使用begin来指定动画开始的时间为另一个的结束。
不清楚有没有更好的办法。
<svg> <rect x="20" y="20" width="241.667" height="250" fill="blue"> <animate attributeType="CSS" attributeName="width" begin="0s; second.end" id="first" from="250" to="0" dur="1s"></animate> <animate attributeType="CSS" attributeName="width" begin="first.end" id="second" from="0" to="250" dur="1s"></animate> </rect> </svg>
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
如果只是单纯的改变宽度,少年可以这样实现
给animate添加id后,使用begin来指定动画开始的时间为另一个的结束。
不清楚有没有更好的办法。