From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/screen/availheight/index.html | 83 +++++++++++++++ files/ja/web/api/screen/availleft/index.html | 45 ++++++++ files/ja/web/api/screen/availtop/index.html | 38 +++++++ files/ja/web/api/screen/availwidth/index.html | 23 +++++ files/ja/web/api/screen/colordepth/index.html | 59 +++++++++++ files/ja/web/api/screen/height/index.html | 58 +++++++++++ files/ja/web/api/screen/index.html | 100 ++++++++++++++++++ files/ja/web/api/screen/left/index.html | 34 ++++++ files/ja/web/api/screen/lockorientation/index.html | 115 +++++++++++++++++++++ files/ja/web/api/screen/mozbrightness/index.html | 30 ++++++ files/ja/web/api/screen/mozenabled/index.html | 30 ++++++ .../web/api/screen/onorientationchange/index.html | 58 +++++++++++ files/ja/web/api/screen/orientation/index.html | 73 +++++++++++++ files/ja/web/api/screen/pixeldepth/index.html | 60 +++++++++++ files/ja/web/api/screen/top/index.html | 37 +++++++ .../ja/web/api/screen/unlockorientation/index.html | 74 +++++++++++++ files/ja/web/api/screen/width/index.html | 57 ++++++++++ 17 files changed, 974 insertions(+) create mode 100644 files/ja/web/api/screen/availheight/index.html create mode 100644 files/ja/web/api/screen/availleft/index.html create mode 100644 files/ja/web/api/screen/availtop/index.html create mode 100644 files/ja/web/api/screen/availwidth/index.html create mode 100644 files/ja/web/api/screen/colordepth/index.html create mode 100644 files/ja/web/api/screen/height/index.html create mode 100644 files/ja/web/api/screen/index.html create mode 100644 files/ja/web/api/screen/left/index.html create mode 100644 files/ja/web/api/screen/lockorientation/index.html create mode 100644 files/ja/web/api/screen/mozbrightness/index.html create mode 100644 files/ja/web/api/screen/mozenabled/index.html create mode 100644 files/ja/web/api/screen/onorientationchange/index.html create mode 100644 files/ja/web/api/screen/orientation/index.html create mode 100644 files/ja/web/api/screen/pixeldepth/index.html create mode 100644 files/ja/web/api/screen/top/index.html create mode 100644 files/ja/web/api/screen/unlockorientation/index.html create mode 100644 files/ja/web/api/screen/width/index.html (limited to 'files/ja/web/api/screen') diff --git a/files/ja/web/api/screen/availheight/index.html b/files/ja/web/api/screen/availheight/index.html new file mode 100644 index 0000000000..88c93ccac0 --- /dev/null +++ b/files/ja/web/api/screen/availheight/index.html @@ -0,0 +1,83 @@ +--- +title: Screen.availHeight +slug: Web/API/Screen/availHeight +tags: + - API + - CSSOM View + - Property + - Reference + - Screen size + - availHeight + - プロパティ +translation_of: Web/API/Screen/availHeight +--- +

{{APIRef("CSSOM")}}

+ +

{{DOMxRef("Screen")}} インターフェイスの availHeight プロパティは読み取り専用で、画面のウェブコンテンツに利用することができる範囲の高さを、 CSS ピクセル単位で返します。 {{DOMxRef("Screen")}} は {{DOMxRef("Window")}} インターフェイスの {{DOMxRef("Window.screen", "window.screen")}} プロパティから得ることができますので、 availHeightwindow.screen.availHeight を使用してアクセスすることができます。

+ +

同様に、 {{DOMxRef("Screen.availWidth")}} を使用してブラウザーがウェブコンテンツに利用することができる水平方向のピクセル数を取得することができます。

+ +

構文

+ +
let availHeight = window.screen.availHeight;
+
+ +

+ +

画面の利用可能な空間の高さを示す CSS ピクセル数を示す数値。これは、 {{DOMxRef("Screen.height", "window.screen.height")}} の値よりも大きくすることはできず、端末やユーザーエージェントがそれ自身のために垂直方向の空間を確保している場合は、より小さくなります。

+ +

例えば、 Dock が画面の一番下 (これが既定) にある Mac の場合、 availHeight の値は、下図のように、 height (CSS ピクセル単位の画面全体の高さ) から Dock とメニューバーの高さを差し引いた値になります。

+ +

Screen.availHeight が Screen.height と画面の内容にどのように関係しているかを示す図

+ +

+ +

ウェブアプリケーションで新しいウィンドウを開く必要がある場合、例えば複数のパネルを含むことができるツールパレットのように、それが利用可能な垂直方向のスペース全体を占めるように配置したい場合、ここで見られるものと同様のコードを使用して行うことができます。

+ +

メインウィンドウでは、パネルを開くときに以下のようなコードを使用します。

+ +
let paletteWindow = window.open("panels.html", "Panels", "left=0, top=0, width=200");
+ +

Panels ウィンドウの HTML (panels.html) には、独自の JavaScript コードがあり、ウィンドウが作成されるとすぐに実行されます。このコードは、特定のイベント (すべてのイベント) を待つ必要もありません。このコードは、利用可能な空間に基づいてウィンドウの寸法の変更を処理します。

+ +
window.outerHeight = window.screen.availHeight;
+ +

結果は以下のようになります。パネルウィンドウが画面の左にある垂直方向の空間をすべて埋めていることに注意してください。

+ +

Screenshot of the example for Screen.availHeight

+ +

Windows システムでは、タスクバーや空間を必要とする他のインターフェイス要素のための空間を残して、利用可能なすべての垂直方向の空間を使用するようにウィンドウを開き、垂直方向に寸法を調整することで、同様に機能します。

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSSOM View', '#dom-screen-availheight', 'Screen.availHeight')}}{{Spec2('CSSOM View')}}初回定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.availHeight")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/availleft/index.html b/files/ja/web/api/screen/availleft/index.html new file mode 100644 index 0000000000..5fe1a35cb9 --- /dev/null +++ b/files/ja/web/api/screen/availleft/index.html @@ -0,0 +1,45 @@ +--- +title: Screen.availLeft +slug: Web/API/Screen/availLeft +tags: + - API + - 'API:Mozilla Extensions' + - 'API:WebKit Extensions' + - DOM + - Non-standard + - Property + - プロパティ +translation_of: Web/API/Screen/availLeft +--- +
{{APIRef("CSSOM")}}{{Non-standard_Header}}
+ +

画面の左端から利用できる最初の有効ピクセルを返します。

+ +

構文

+ +
let availLeft = window.screen.availLeft;
+ +

+ +
let setX = window.screen.width - window.screen.availLeft;
+let setY = window.screen.height - window.screen.availTop;
+window.moveTo(setX, setY);
+
+ +

メモ

+ +

ほとんどの場合においてこのプロパティは、 0 を返します。

+ +

このプロパティを2画面で使用した場合、右側の画面については左側の画面の幅のピクセル数の値 (したがって、右側の画面の左端の X 座標を示す) として評価されます。

+ +

Windows では、このプロパティはどの画面が主画面として設定されているかによって異なり、主画面に対して左端の利用可能なピクセルのX座標を返します。つまり、主画面の左端は、左端の画面でなくても常に X 座標が 0 になります。副画面が主画面の左側にある場合は、補正するために負の X 座標になります。

+ +

[1] [2] - 左の画面では availLeft0 を返し、右の画面では左の画面の width を返す

+ +

[2] [1] - 左の画面では availLeft は右画面の -width を返し、右の画面では 0 を返す

+ +

ブラウザーの対応

+ + + +

{{Compat("api.Screen.availLeft")}}

diff --git a/files/ja/web/api/screen/availtop/index.html b/files/ja/web/api/screen/availtop/index.html new file mode 100644 index 0000000000..a8cba7bc0c --- /dev/null +++ b/files/ja/web/api/screen/availtop/index.html @@ -0,0 +1,38 @@ +--- +title: Screen.availTop +slug: Web/API/Screen/availTop +tags: + - API + - 'API:Mozilla Extensions' + - 'API:WebKit Extensions' + - DOM + - Non-standard + - Property + - プロパティ +translation_of: Web/API/Screen/availTop +--- +

{{APIRef("CSSOM")}}{{Non-standard_Header}}

+ +

固定あるいは半固定されているユーザーインターフェイス部分を含まない、最初のピクセルの y 座標を示します。

+ +

構文

+ +
let availTop = window.screen.availTop;
+
+ +

+ +
let setX = window.screen.width - window.screen.availLeft;
+let setY = window.screen.height - window.screen.availTop;
+window.moveTo(setX, setY);
+
+ +

+ +

ほとんどの場合において、このプロパティは、 0 を返します。

+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.availTop")}}

diff --git a/files/ja/web/api/screen/availwidth/index.html b/files/ja/web/api/screen/availwidth/index.html new file mode 100644 index 0000000000..244320ecfa --- /dev/null +++ b/files/ja/web/api/screen/availwidth/index.html @@ -0,0 +1,23 @@ +--- +title: window.screen.availWidth +slug: Web/API/Screen/availWidth +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference + - screen +translation_of: Web/API/Screen/availWidth +--- +
+ {{ApiRef}}
+

概要

+

ウィンドウで利用可能な水平空間の大きさをピクセル単位で返します。

+

構文

+
iAvail = window.screen.availWidth
+

+
var screenAvileWidth = window.screen.availWidth;
+
+console.log(screenAvileWidth);
+

仕様

+

{{DOM0}}

diff --git a/files/ja/web/api/screen/colordepth/index.html b/files/ja/web/api/screen/colordepth/index.html new file mode 100644 index 0000000000..b08de5a98e --- /dev/null +++ b/files/ja/web/api/screen/colordepth/index.html @@ -0,0 +1,59 @@ +--- +title: Screen.colorDepth +slug: Web/API/Screen/colorDepth +tags: + - API + - CSSOM View + - Property + - Reference + - プロパティ +translation_of: Web/API/Screen/colorDepth +--- +

{{APIRef("CSSOM")}}

+ +

Screen.colorDepth は読み取り専用プロパティで、画面の色震度を返します。 CSSOM により、互換性の理由から 24 を返す実装もあります。そうでないものについては、ブラウザーの互換性の節を参照してください。

+ +

構文

+ +
bitDepth = window.screen.colorDepth;
+ +

+ +
// 画面の色震度をチェック
+if ( window.screen.colorDepth < 8) {
+  // Use low-color version of page
+} else {
+  // Use regular, colorful page
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSSOM View', '#dom-screen-colordepth', 'Screen.colorDepth')}}{{Spec2('CSSOM View')}}初回定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.colorDepth")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/height/index.html b/files/ja/web/api/screen/height/index.html new file mode 100644 index 0000000000..96a14b18ef --- /dev/null +++ b/files/ja/web/api/screen/height/index.html @@ -0,0 +1,58 @@ +--- +title: Screen.height +slug: Web/API/Screen/height +tags: + - API + - CSSOM View + - NeedsMarkupWork + - NeedsMobileBrowserCompatibility + - Property + - Reference + - プロパティ +translation_of: Web/API/Screen/height +--- +

{{APIRef("CSSOM")}}

+ +

Screen.height は読み取り専用プロパティで、画面の高さをピクセル数で返します。

+ +

構文

+ +
var height = window.screen.height
+ +

+ +
if (window.screen.availHeight !== window.screen.height) {
+   // Something is occupying some screen real estate!
+}
+
+ +

+ +

このプロパティによって与えられる高さのすべてがウィンドウに利用できるわけではないことに注意してください。タスクバーなどのウィジェットや、 OS と統合された他の特殊なアプリケーションウィンドウ (例えば、ウィンドウの上で追加のツールバーのように動作するように最小化された Spinner プレイヤーなど) は、ブラウザーウィンドウや他のアプリケーションに利用可能な空間の量を減らすことがあります。

+ +

Internet Explorer は、画面の高さを報告する際に拡大率の設定を考慮します。拡大率が 100% に設定されている場合のみ、実際の画面の高さを返します。

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSSOM View', '#dom-screen-height', 'Screen.height')}}{{Spec2('CSSOM View')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.height")}}

diff --git a/files/ja/web/api/screen/index.html b/files/ja/web/api/screen/index.html new file mode 100644 index 0000000000..ff49e2676b --- /dev/null +++ b/files/ja/web/api/screen/index.html @@ -0,0 +1,100 @@ +--- +title: Screen +slug: Web/API/Screen +tags: + - API + - CSSOM View + - Interface + - Reference +translation_of: Web/API/Screen +--- +
{{APIRef("CSSOM")}}
+ +

Screen インターフェイスは画面を表し、通常は、現在のウィンドウが描画されている画面であり、 {{DOMxRef("window.screen")}} を使用して取得されます。

+ +

なお、ブラウザーはブラウザーのウィンドウの中心がどの画面にあるかを検出することで、報告する現在の画面がどれかを判断します。

+ +

プロパティ

+ +
+
{{DOMxRef("Screen.availTop")}} {{Non-standard_Inline}}
+
オペレーティングシステムによって表示されるウィンドウ上のタスクバーなどの、固定あるいは半固定のユーザーインターフェイス部分を含まない、最初のピクセルの y 座標を指します。
+
{{DOMxRef("Screen.availLeft")}} {{Non-standard_Inline}}
+
スクリーンの左端からの、最初の利用可能なピクセルの値を返します。​
+
{{DOMxRef("Screen.availHeight")}}
+
固定あるいは半固定のユーザーインターフェイス部分を除いたスクリーンの高さをピクセルで表します。
+
{{DOMxRef("Screen.availWidth")}}
+
ウィンドウで利用可能な水平方向のスペースの合計をピクセルで返します。
+
{{DOMxRef("Screen.colorDepth")}}
+
画面の色深度を返します。
+
{{DOMxRef("Screen.height")}}
+
画面の高さをピクセルで返します。
+
{{DOMxRef("Screen.left")}} {{Non-standard_Inline}}
+
メイン画面の左端から現在の画面の左端までの距離をピクセルで返します。
+
{{DOMxRef("Screen.orientation")}}
+
現在の画面の向きを返します。
+
{{DOMxRef("Screen.pixelDepth")}}
+
画面のピット深度を取得します。
+
{{DOMxRef("Screen.top")}} {{Non-standard_Inline}}
+
現在の画面の上端からの距離をピクセルで返します。 
+
{{DOMxRef("Screen.width")}}
+
画面の幅を返します。
+
{{DOMxRef("Screen.mozEnabled")}} {{Non-standard_Inline}} {{Deprecated_Inline}}{{Gecko_MinVersion_Inline(12)}}
+
ブール値。false に設定すると、デバイスの画面がオフになります。
+
{{DOMxRef("Screen.mozBrightness")}} {{Non-standard_Inline}} {{Deprecated_Inline}}{{Gecko_MinVersion_Inline(12)}}
+
デバイスの画面の明るさをコントロールします。0 から 1.0 までの double で指定します。
+
+ +

イベントハンドラー

+ +
+
{{DOMxRef("Screen.onorientationchange")}} {{Deprecated_Inline}}
+
{{Event("orientationchange")}} イベントのハンドラー。
+
+ +

メソッド

+ +
+
{{DOMxRef("Screen.lockOrientation")}}
+
画面の向きをロックします (全画面かインストールしたアプリでのみ動作します)
+
{{DOMxRef("Screen.unlockOrientation")}}
+
画面の向きのロックを解除します。 (全画面時かインストールしたアプリでのみ動作します)
+
+ +

メソッドは {{DOMxRef("EventTarget")}} から継承されています。

+ +

{{Page("/en-US/docs/Web/API/EventTarget", "Methods")}}

+ +

+ +
if (screen.pixelDepth < 8) {
+  // 色数の少ないバージョンのページを使う
+} else {
+  // 通常の色数のページを使う
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("CSSOM View", "#the-screen-interface", "Screen")}}{{Spec2("CSSOM View")}}初回定義
+ +

ブラウザーの対応

+ + + +

{{Compat("api.Screen")}}

diff --git a/files/ja/web/api/screen/left/index.html b/files/ja/web/api/screen/left/index.html new file mode 100644 index 0000000000..9e622ef110 --- /dev/null +++ b/files/ja/web/api/screen/left/index.html @@ -0,0 +1,34 @@ +--- +title: Screen.left +slug: Web/API/Screen/left +tags: + - API + - 'API:Microsoft Extensions' + - 'API:Mozilla Extensions' + - 'API:WebKit Extensions' + - DOM + - Non-standard + - Property + - プロパティ +translation_of: Web/API/Screen/left +--- +

{{APIRef("CSSOM")}}{{Non-standard_Header}}

+ +

メイン画面の左端から現在の画面の左端までの距離をピクセル単位で返します。

+ +

構文

+ +
var left = window.screen.left;
+
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.left")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/lockorientation/index.html b/files/ja/web/api/screen/lockorientation/index.html new file mode 100644 index 0000000000..19fbbaf291 --- /dev/null +++ b/files/ja/web/api/screen/lockorientation/index.html @@ -0,0 +1,115 @@ +--- +title: Screen.lockOrientation() +slug: Web/API/Screen/lockOrientation +tags: + - API + - CSSOM View + - Method + - NeedsUpdate + - Screen Orientation + - screen + - メソッド +translation_of: Web/API/Screen/lockOrientation +--- +

{{APIRef("Screen Orientation API")}}{{Deprecated_Header}}

+ +

lockOrientation() は {{DOMxRef("Screen")}} インターフェイスのメソッドで、画面を特定の方向にロックします。代わりに {{DOMxRef("ScreenOrientation.lock()")}} メソッドを使用してください。

+ +
+

注: このメソッドはインストールされたウェブアプリまたは全画面モードのウェブページでのみ動作します。

+
+ +

構文

+ +
lockAllowed = window.screen.lockOrientation(orientation);
+ +

引数

+ +
+
orientation
+
画面をロックする向きです。文字列または文字列の配列で指定します。複数の文字列を渡したときは、選択した向きでのみ回転できるようになります。
+
+ +

以下の文字列表現が向きとして指定できます。

+ +
+
portrait-primary
+
メインのポートレートモードであるスクリーンの向きを表します。メインのポートレートモードとは、デバイスを通常の向きが縦向きの場合と、デバイスの通常の位置が横向きの場合に時計回りに 90° 回転させた向きの場合です。どの向きが通常の向きであるかは、デバイスによって異なります。
+
portrait-secondary
+
2番目のポートレートモードであるスクリーンの向きを表します。2番目のポートレートモードとは、デバイスを通常の向きが縦向きでそこから 180° 回転させた場合と、デバイスの通常の位置が横向きの場合に反時計回りに 90° 回転させた向きの場合です。どの向きが通常の向きであるかは、デバイスによって異なります。
+
landscape-primary
+
メインのランドスケープモードであるスクリーンの向きを表します。メインのランドスケープモードとは、デバイスを通常の向きが横向きの場合と、デバイスの通常の位置が縦向きの場合に時計回りに 90° 回転させた向きの場合です。どの向きが通常の向きであるかは、デバイスによって異なります。
+
landscape-secondary
+
2番目のランドスケープモードであるスクリーンの向きを表します。2番目のランドスケープモードとは、デバイスを通常の向きが横向きでそこから 180° 回転させた場合と、デバイスの通常の位置が縦向きの場合に反時計回りに 90° 回転させた向きの場合です。どの向きが通常の向きであるかは、デバイスによって異なります。
+
portrait
+
portrait-primary と portrait-secondary の両方を表します。
+
landscape
+
landscape-primarylandscape-secondary の両方を表します。
+
default
+
デバイスに自然な向きによって portrait-primary または landscape-primary が選ばれます。たとえば、ディスプレイの解像度が 1280*800 なら、 defaultlandscape になるでしょうし、800*1280 なら、 defaultportrait になるでしょう。
+
+ +
+

注: 複数のロックが同時に指定されることがあります。そのため、1つの向きにのみロックがセットされた場合には、スクリーンの向きはロックが解除されるまで決して変更されません。もしそうでなければ、デバイスがロックされた向きを含む複数の向きの間で、スクリーンの向きが1つの向きから別の向きへと移り変わってしまうことになります。

+
+ +

返値

+ +

向きの固定が許可された場合には true が返り、向きのロックが拒否された場合には false が返ります。返値は、必ずしもスクリーンの向きが実際にロックされていることを示すわけではないことに注意してください。遅延がある可能性があるからです。

+ +

+ +

DOMString 引数での使用方法

+ +
screen.lockOrientationUniversal = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;
+
+if (screen.lockOrientationUniversal("landscape-primary")) {
+  // 向きがロックされた
+} else {
+  // 向きのロックに失敗した
+}
+
+ +

Array 引数での使用方法

+ +
screen.lockOrientationUniversal = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;
+
+if (screen.lockOrientationUniversal(["landscape-primary", "landscape-secondary"])) {
+  // 向きがロックされた
+} else {
+  // 向きのロックに失敗した
+}
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Screen Orientation', 'published/20140220.html#extensions-to-the-screen-interface', 'lockOrientation()')}}{{Spec2('Screen Orientation')}}初回定義 (もう草稿には存在しません)
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.lockOrientation")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/mozbrightness/index.html b/files/ja/web/api/screen/mozbrightness/index.html new file mode 100644 index 0000000000..5d6c476ed1 --- /dev/null +++ b/files/ja/web/api/screen/mozbrightness/index.html @@ -0,0 +1,30 @@ +--- +title: Screen.mozBrightness +slug: Web/API/Screen/mozBrightness +tags: + - API + - 'API:Mozilla Extensions' + - Deprecated + - Non-standard + - Property +translation_of: Web/API/Screen/mozBrightness +--- +

{{APIRef("CSSOM")}}{{Non-standard_Header}}{{Deprecated_Header}}

+ +

画面のバックライトの明るさを、 0 (とても暗い) から 1 (完全に明るい) の範囲で示します。この値は倍精度浮動小数点数です。

+ +

この属性は、画面が無効化されていても読み書きできますが、画面が無効化されている間はバックライトが消灯しています。この属性に X の値を書き込むと、後で読み込んだときに同じ X の値になっていない場合があります。ほとんどの画面は倍精度の 0 と 1 の数だけ輝度レベルがあるわけではありません。値を格納する前に、値の精度が低下する可能性があります。

+ +

構文

+ +
let screenBrightness = window.screen.mozBrightness;
+ +

仕様書

+ +

仕様書の一部ではありません。

+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.mozBrightness")}}

diff --git a/files/ja/web/api/screen/mozenabled/index.html b/files/ja/web/api/screen/mozenabled/index.html new file mode 100644 index 0000000000..dede4f120f --- /dev/null +++ b/files/ja/web/api/screen/mozenabled/index.html @@ -0,0 +1,30 @@ +--- +title: Screen.mozEnabled +slug: Web/API/Screen/mozEnabled +tags: + - API + - 'API:Mozilla Extensions' + - DOM + - Deprecated + - Non-standard + - Property + - Reference +translation_of: Web/API/Screen/mozEnabled +--- +

{{APIRef("CSSOM")}}{{Non-standard_Header}}{{Deprecated_Header}}

+ +

これは論理値で、端末の画面を制御します。 false に設定すると画面をオフにします。

+ +

構文

+ +
let screenEnabled = window.screen.mozEnabled
+ +

仕様書

+ +

仕様書の一部ではありません。

+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.mozEnabled")}}

diff --git a/files/ja/web/api/screen/onorientationchange/index.html b/files/ja/web/api/screen/onorientationchange/index.html new file mode 100644 index 0000000000..bc583781e0 --- /dev/null +++ b/files/ja/web/api/screen/onorientationchange/index.html @@ -0,0 +1,58 @@ +--- +title: Screen.onorientationchange +slug: Web/API/Screen/onorientationchange +tags: + - API + - CSSOM View + - Deprecated + - Event Handler + - Property + - Screen Orientation +translation_of: Web/API/Screen/onorientationchange +--- +

{{APIRef("Screen Orientation API")}}{{Deprecated_Header}}

+ +
+

警告: これは標準外で非推奨の機能であり、 Firefox だけが異なる名前で実装されていました。代わりに {{DOMxRef("ScreenOrientation.onchange")}} を使用してください。

+
+ +

Screen オブジェクトに送信される {{domxref("Window/orientationchange_event", "orientationchange")}} イベントのイベントハンドラーです。

+ +

構文

+ +
screen.onorientationchange = funcRef;
+
+ +

ここで funcRef は関数への参照です。

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Screen Orientation', 'published/20140220.html#extensions-to-the-screen-interface', 'onorientationchange')}}{{Spec2('Screen Orientation')}}初回定義 (草稿には既に存在しません)
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.onorientationchange")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/orientation/index.html b/files/ja/web/api/screen/orientation/index.html new file mode 100644 index 0000000000..3bcf1c25b5 --- /dev/null +++ b/files/ja/web/api/screen/orientation/index.html @@ -0,0 +1,73 @@ +--- +title: Screen.orientation +slug: Web/API/Screen/orientation +tags: + - API + - CSSOM View + - Experimental + - Orientation + - Property + - Read-only + - Screen Orientation + - screen +translation_of: Web/API/Screen/orientation +--- +
{{APIRef("Screen Orientation API")}}{{SeeCompatTable}}
+ +

orientation は {{DOMxRef("Screen")}} インターフェイスの読み取り専用プロパティで、現在の画面の向きを返します。

+ +

構文

+ +
var orientation = window.screen.orientation;
+ +

返値

+ +

画面の向きを表す {{DOMxRef("ScreenOrientation")}} のインスタンスです。

+ +

なお、古い接頭辞付きのものは {{DOMxRef("DOMString")}} で {{DOMxRef("ScreenOrientation.type")}} と同等のものを返していました。

+ +

+ +
var orientation = screen.msOrientation || screen.mozOrientation || (screen.orientation || {}).type;
+
+if (orientation === "landscape-primary") {
+  console.log("良い感じですね。");
+} else if (orientation === "landscape-secondary") {
+  console.log("うーん…。画面が上下逆です!");
+} else if (orientation === "portrait-secondary" || orientation === "portrait-primary") {
+  console.log("うーん…。スクリーンを横向きにした方がいいですよ");
+} else if (orientation === undefined) {
+  console.log("このブラウザーは orientation API に対応していません :(");
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Screen Orientation', '#dom-screen-orientation', 'orientation')}}{{Spec2('Screen Orientation')}}初回定義
+ +

ブラウザーの対応

+ +

{{Compat("api.Screen.orientation")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/pixeldepth/index.html b/files/ja/web/api/screen/pixeldepth/index.html new file mode 100644 index 0000000000..b32a3908e1 --- /dev/null +++ b/files/ja/web/api/screen/pixeldepth/index.html @@ -0,0 +1,60 @@ +--- +title: Screen.pixelDepth +slug: Web/API/Screen/pixelDepth +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference + - screen +translation_of: Web/API/Screen/pixelDepth +--- +

{{APIRef("CSSOM")}}

+ +

画面のビット深度を返します。CSSOM により、互換性の理由から 24 を返す実装もあります。そうでないものについては、{{anch("Browser compatibility", "ブラウザーの互換性")}}の節を参照してください。

+ +

構文

+ +
let depth = window.screen.pixelDepth
+ +

+ +
// if there is not adequate bit depth
+// choose a simpler color
+if ( window.screen.pixelDepth > 8 ) {
+  document.style.color = "#FAEBD7";
+} else {
+  document.style.color = "#FFFFFF";
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSSOM View', '#dom-screen-pixeldepth', 'Screen.pixelDepth')}}{{Spec2('CSSOM View')}}初回定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.pixelDepth")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/top/index.html b/files/ja/web/api/screen/top/index.html new file mode 100644 index 0000000000..3246c03655 --- /dev/null +++ b/files/ja/web/api/screen/top/index.html @@ -0,0 +1,37 @@ +--- +title: Screen.top +slug: Web/API/Screen/top +tags: + - API + - 'API:Microsoft Extensions' + - 'API:Mozilla Extensions' + - 'API:WebKit Extensions' + - DOM + - Non-standard + - Property + - Window +translation_of: Web/API/Screen/top +--- +

{{APIRef("CSSOM")}}{{Non-standard_Header}}

+ +

現在の画面の上端からの距離をピクセル単位で返します。

+ +

構文

+ +
let top = window.screen.top;
+ +

仕様書

+ +

仕様書の一部ではありません。

+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.left")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/unlockorientation/index.html b/files/ja/web/api/screen/unlockorientation/index.html new file mode 100644 index 0000000000..ab45c186ef --- /dev/null +++ b/files/ja/web/api/screen/unlockorientation/index.html @@ -0,0 +1,74 @@ +--- +title: Screen.unlockOrientation() +slug: Web/API/Screen/unlockOrientation +tags: + - API + - CSSOM View + - Method + - NeedsMarkupWork + - Screen Orientation + - メソッド + - 画面の方向 +translation_of: Web/API/Screen/unlockOrientation +--- +

{{APIRef("Screen Orientation API")}}{{Deprecated_Header}}

+ +

Screen.unlockOrientation() メソッドは、ページやアプリによって設定されているすべての画面のロックを除去します。代わりに {{DOMxRef("ScreenOrientation.unlock()")}} を使用してください。

+ +
+

注: このメソッドはインストールされたウェブアプリまたは全画面モードのウェブページでのみ動作します。

+
+ +

構文

+ +
var unlocked = window.screen.unlockOrientation();
+
+ +

返値

+ +

向きの固定の解除が成功した場合に true が、解除されなかった場合に false が返されます。

+ +

+ +
var unlockOrientation = screen.unlockOrientation || screen.mozUnlockOrientation || screen.msUnlockOrientation || (screen.orientation && screen.orientation.unlock);
+
+if (unlockOrientation()) {
+  // 向きのロックが解除されました
+} else {
+  // 向きのロックの解除に失敗しました
+}
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Screen Orientation', 'published/20140220.html#extensions-to-the-screen-interface', 'lockOrientation()')}}{{Spec2('Screen Orientation')}}初回定義 (もう草稿には存在しません)
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.unlockOrientation")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/screen/width/index.html b/files/ja/web/api/screen/width/index.html new file mode 100644 index 0000000000..9225969cba --- /dev/null +++ b/files/ja/web/api/screen/width/index.html @@ -0,0 +1,57 @@ +--- +title: Screen.width +slug: Web/API/Screen/width +tags: + - API + - CSSOM View + - Property + - Reference +translation_of: Web/API/Screen/width +--- +

{{APIRef("CSSOM")}}

+ +

画面の幅を返します。

+ +

構文

+ +
lWidth = window.screen.width
+
+ +

+ +
// Crude way to check that the screen is at least 1024x768
+if (window.screen.width >= 1024 && window.screen.height >= 768) {
+  // Resolution is 1024x768 or above
+}
+
+ +

+ +

このプロパティによって与えられた幅のすべてがウィンドウ自体に利用できるとは限らないことに注意してください。他のウィジェットが window オブジェクトで使用できない空間を占有している場合は、 window.screen.widthwindow.screen.availWidth に違いがあります。 {{DOMxRef("screen.height")}} も参照してください。

+ +

Internet Explorer は、画面の幅を報告する際に拡大率の設定を考慮します。拡大率が 100% に設定されている場合のみ、実際の画面の幅を返します。

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSSOM View', '#dom-screen-height', 'Screen.height')}}{{Spec2('CSSOM View')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Screen.height")}}

-- cgit v1.2.3-54-g00ecf