html5 - svg如何做到一組動(dòng)畫循環(huán)
問題描述
問題解答
回答1:如果只是單純的改變寬度,少年可以這樣實(shí)現(xiàn)
<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來指定動(dòng)畫開始的時(shí)間為另一個(gè)的結(jié)束。
不清楚有沒有更好的辦法。
<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>
相關(guān)文章:
1. mysql - 請(qǐng)問數(shù)據(jù)庫字段為年月日,傳進(jìn)的參數(shù)為月,怎么查詢那個(gè)月所對(duì)應(yīng)的數(shù)據(jù)2. node.js - win 下 npm install 遇到了如下錯(cuò)誤 會(huì)導(dǎo)致 無法 run dev么?3. javascript - 我的站點(diǎn)貌似被別人克隆了, google 搜索特定文章,除了域名不一樣,其他的都一樣,如何解決?4. 求救一下,用新版的phpstudy,數(shù)據(jù)庫過段時(shí)間會(huì)消失是什么情況?5. [python2]local variable referenced before assignment問題6. Python2中code.co_kwonlyargcount的等效寫法7. html - 移動(dòng)端radio無法選中8. php - 微信開發(fā)驗(yàn)證服務(wù)器有效性9. javascript - vue+iview upload傳參失敗 跨域問題后臺(tái)已經(jīng)解決 仍然報(bào)403,這是怎么回事啊?10. mysql - 如何在有自增id的情況下,讓其他某些字段能不重復(fù)插入
