文章详情页
html5 - svg如何做到一组动画循环
浏览:42日期:2023-01-29 15:27:39
问题描述
问题解答
回答1:如果只是单纯的改变宽度,少年可以这样实现
<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>回答2:
给animate添加id后,使用begin来指定动画开始的时间为另一个的结束。
不清楚有没有更好的办法。
<svg> <rect x='20' y='20' fill='blue'><animate attributeType='CSS' attributeName='width' begin='0s; second.end' from='250' to='0' dur='1s'></animate><animate attributeType='CSS' attributeName='width' begin='first.end' from='0' to='250' dur='1s'></animate> </rect></svg>
标签:
Html5
相关文章:
1. html5 - 如何让H5页面在手机浏览器里和微信全屏显示2. javascript - react如何获取offsetX?3. node.js - nodejs开发中常用的连接mysql的库4. MYSQL代码执行错误:FUNCTION any_value does not exist5. 微信小程序如何加载h5页面6. paramiko - Python tempfile生成的文件能不能拷贝到远程服务器?7. mysql - oracle物化视图和临时表的区别是什么?8. 网页爬虫 - python+requests 网页重定向求解9. css - calc()设置宽度等于自身的高度?10. javascript - 关于json中获取多个key-value对中多层嵌套key的name
排行榜