CSSNumericValue.type()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。
type() は CSSNumericValue インターフェイスのメソッドで、 CSSNumericValue の型をf angle, flex,
frequency, length, resolution,
percent, percentHint, time の何れかで返します。
構文
js
type();
引数
なし。
返値
CSSNumericType オブジェクトです。
例外
なし。
例
js
let mathSum = CSS.px("23")
.sub(CSS.percent("4"))
.sub(CSS.cm("3"))
.sub(CSS.in("9"));
// Returns an object with the structure: {length: 1, percentHint: "length"}
let cssNumericType = mathSum.type();
仕様書
| Specification |
|---|
| CSS Typed OM Level 1> # dom-cssnumericvalue-type> |
ブラウザーの互換性
Loading…