SVGMarkerElement: setOrientToAuto() 方法
SVGMarkerElement 介面的 setOrientToAuto() 方法將 orient 屬性的值設定為 auto。
語法
js
setOrientToAuto()
引數
無。
返回值
無(undefined)。
示例
在下面的示例中,orient 屬性的值使用 setOrientToAuto() 進行更新。
html
<svg id="svg" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker
id="arrow"
viewBox="0 0 10 10"
refX="5"
refY="5"
markerWidth="6"
markerHeight="6"
orient="90">
<path d="M 0 0 L 10 5 L 0 10 z" />
</marker>
</defs>
</svg>
js
let marker = document.getElementById("arrow");
console.log(marker.orientAngle.baseVal.value);
marker.setOrientToAuto();
console.log(marker.orientAngle.baseVal.value);
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # __svg__SVGMarkerElement__setOrientToAuto |
瀏覽器相容性
載入中…