SVGAnimatedInteger: thuộc tính animVal
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 animVal của giao diện SVGAnimatedInteger đại diện cho giá trị hoạt hình của một <integer>. Nếu không có hoạt hình nào được áp dụng, animVal bằng với baseVal.
Một số thuộc tính, như thuộc tính numOctaves của phần tử <feTurbulence> hoặc thuộc tính order của phần tử <feConvolveMatrix>, chấp nhận số nguyên long làm giá trị. Thuộc tính này cung cấp quyền truy cập vào trạng thái hoạt hình hiện tại của thuộc tính dưới dạng số.
Giá trị
Một long; giá trị hoạt hình của thuộc tính.
Ví dụ
js
const feTurbulence = document.querySelector("feTurbulence");
// Đặt thuộc tính 'numOctaves' có thể hoạt hình
feTurbulence.setAttribute("numOctaves", "4");
// Truy cập đối tượng SVGAnimatedInteger
const animatedInteger = feTurbulence.numOctaves;
// Lấy giá trị hoạt hình (chỉ đọc)
console.log(animatedInteger.animVal); // Đầu ra: 4 (giá trị hoạt hình hiện tại)
Thông số kỹ thuật
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # __svg__SVGAnimatedInteger__animVal> |