SVGFESpotLightElement: x 屬性

Baseline 已廣泛支援

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2015 年 7 月⁩以來,各瀏覽器均已提供此特性。

SVGFESpotLightElement 介面的只讀屬性 x,描述了一個 SVG 濾鏡原件位置的水平座標,其型別為 SVGAnimatedNumber

它反映了 <feSpotLight> 元素的 x 屬性,該屬性可用於定義聚光燈效果中的光源。該屬性是一個 <number>。預設值為 0

一個 SVGAnimatedNumber

示例

js
const feSpotLight = document.querySelector("feSpotLight");
const leftPosition = feSpotLight.x;
console.log(leftPosition.baseVal.value); // the `x` value

規範

規範
濾鏡效果模組第 1 級
# dom-svgfespotlightelement-x

瀏覽器相容性

另見