CSSNumericValue.min()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。
min()
は CSSNumericValue
インターフェイスのメソッドで、渡された値のうちで最も小さい値を返します。渡された値は同じ型でなければなりません。
構文
js
min(number1, /* ..., */ numberN);
引数
number1
, …,numberN
-
数値または
CSSNumericValue
です。
返値
A CSSUnitValue
.
例外
TypeError
-
無効な型がメソッドに渡された場合に発生します。
例
先に述べたように、渡される値はすべて同じ型と値でなければなりません。以下のいくつかの例では、それらが異なる場合に何が起こるかを説明しています。
js
// Prints "1cm"
console.log(CSS.cm("1").min(CSS.cm("2")).toString());
// Prints "max(1cm, 0.393701in)"
console.log(CSS.cm("1").max(CSS.in("0.393701")).toString());
仕様書
Specification |
---|
CSS Typed OM Level 1 # dom-cssnumericvalue-min |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
min |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.