成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

html5 - svg如何做到一組動(dòng)畫(huà)循環(huán)

瀏覽:136日期:2023-01-29 15:27:39

問(wèn)題描述

問(wè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來(lái)指定動(dòng)畫(huà)開(kāi)始的時(shí)間為另一個(gè)的結(jié)束。

不清楚有沒(méi)有更好的辦法。

<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>

標(biāo)簽: Html5
相關(guān)文章: