SVGFEMorphologyElement:radiusX 属性
SVGFEMorphologyElement
接口的只读属性 radiusX
反映了给定 <feMorphology>
元素的 radius
属性的 X 分量。
值
一个 SVGAnimatedNumber
对象。
示例
访问 radiusX
属性
html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="morphologyFilter">
<!-- Applies a morphology filter with a specific radius -->
<feMorphology in="SourceGraphic" operator="dilate" radius="5 3" />
</filter>
</defs>
<rect
x="20"
y="20"
width="100"
height="100"
fill="lightblue"
filter="url(#morphologyFilter)" />
</svg>
js
// Select the feMorphology element
const morphologyNode = document.querySelector("feMorphology");
// Access the radiusX property
const radiusX = morphologyNode.radiusX.baseVal;
console.log(`The X radius is: ${radiusX}`); // Output: 5
规范
规范 |
---|
滤镜效果模块第 1 级 # dom-svgfemorphologyelement-radiusx |
浏览器兼容性
加载中…