SVGFEDisplacementMapElement: x 屬性

Baseline 已廣泛支援

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

SVGFEDisplacementMapElement 介面的只讀屬性 x 描述了 SVG 濾鏡圖元的水平座標,其型別為 SVGAnimatedLength

它反映了 <feDisplacementMap> 元素的 x 濾鏡圖元屬性值。該屬性可以是 <length><percentage><coordinate> 是使用者座標系中的一個長度,表示使用者座標系原點沿 x 軸的給定距離。如果 x 屬性是百分比值,則屬性值相對於使用者座標系單位中濾鏡區域的寬度而言。

一個 SVGAnimatedLength 物件。

示例

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

規範

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

瀏覽器相容性

另見