課程
/前端開發
/Html5
/走進SVG
怎樣實現一個元素演一個ellipse標簽的橢圓移動,animatemotion對于ellipse標簽的路徑沒有反應啊
2017-03-26
源自:走進SVG 7-3
正在回答
用path畫一個橢圓
<svg viewBox="-400 -400 800 800" width="400" height="400">
<circle cx="0" cy="0" r="8" fill="red">
<animateMotion
dur="5s"
repeatCount="indefinite"
>
<mpath xlink:href="#ell"></mpath>
</animateMotion>
</circle>
<path id="ell" d="M200 0 A200 100 0 0 1 -200 0 A200 100 0 0 1 200 0 " fill="none" stroke="gray"></path>
</svg>
舉報
SVG是HTML5 中矢量圖的標記語言,學習后掌握更多的干貨
1 回答橢圓個數問題
1 回答沿貝塞爾曲線移動的問題
1 回答移動端
2 回答半圓怎么畫
1 回答圓角矩形創建
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-02-27
用path畫一個橢圓
<svg viewBox="-400 -400 800 800" width="400" height="400">
<circle cx="0" cy="0" r="8" fill="red">
<animateMotion
dur="5s"
repeatCount="indefinite"
>
<mpath xlink:href="#ell"></mpath>
</animateMotion>
</circle>
<path id="ell" d="M200 0 A200 100 0 0 1 -200 0 A200 100 0 0 1 200 0 " fill="none" stroke="gray"></path>
</svg>