文章详情页
html5 - svg如何做到一组动画循环
问题描述
问题解答
回答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. python - 请问用cxfreeze打包的可执行程序能反编译出源码么?2. javascript - 这种上传图片预览怎么做?3. javascript - prismplayer播放器全屏问题4. javascript - vue2.0中router.repalce跟router.push有什么区别,二者的应用场景是会有怎样的区别?5. javascript - js判断一个数组是否重复6. javascript - input输入框触发change事件后,外部元素会被选中7. python - 用__call__ 实现装饰器功能8. javascript - 把字符串日期转换成一般时间格式后,发现小于10的数字不会自动添加0在前面,如下9. python相关问题求解决,有偿10. javascript - 在sublime中如何给.vue文件注释?
排行榜