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/zh-cn/web/api/window/screen/index.html | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 files/zh-cn/web/api/window/screen/index.html (limited to 'files/zh-cn/web/api/window/screen/index.html') diff --git a/files/zh-cn/web/api/window/screen/index.html b/files/zh-cn/web/api/window/screen/index.html new file mode 100644 index 0000000000..699d85d5c7 --- /dev/null +++ b/files/zh-cn/web/api/window/screen/index.html @@ -0,0 +1,32 @@ +--- +title: Window.screen +slug: Web/API/Window/screen +tags: + - screen +translation_of: Web/API/Window/screen +--- +
{{APIRef("CSSOM View")}}
+ +

返回当前window的screen对象。screen对象实现了{{domxref("Screen")}}接口,它是个特殊的对象,返回当前渲染窗口中和屏幕有关的属性。

+ +

语法

+ +
screenObj = window.screen;
+
+ +

 

+ +

示例

+ +

 

+ +
if (screen.pixelDepth < 8) {
+  // use low-color version of page
+} else {
+  // use regular, colorful page
+}
+
+ +

Specification

+ +

TBD

-- cgit v1.2.3-54-g00ecf