SVGFESpotLightElement: x property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Thuộc tính chỉ đọc x của giao diện SVGFESpotLightElement mô tả tọa độ ngang của vị trí của một SVG filter primitive dưới dạng SVGAnimatedNumber.

Nó phản ánh thuộc tính x của phần tử <feSpotLight>, có thể được sử dụng để xác định nguồn sáng trong hiệu ứng spotlight. Thuộc tính là <number>. Giá trị mặc định là 0.

Giá trị

Một SVGAnimatedNumber.

Ví dụ

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

Thông số kỹ thuật

Specification
Filter Effects Module Level 1
# dom-svgfespotlightelement-x

Tương thích trình duyệt

Xem thêm