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/devicelightevent/index.html | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 files/zh-cn/web/api/devicelightevent/index.html (limited to 'files/zh-cn/web/api/devicelightevent/index.html') diff --git a/files/zh-cn/web/api/devicelightevent/index.html b/files/zh-cn/web/api/devicelightevent/index.html new file mode 100644 index 0000000000..3dffcc79b6 --- /dev/null +++ b/files/zh-cn/web/api/devicelightevent/index.html @@ -0,0 +1,61 @@ +--- +title: DeviceLightEvent +slug: Web/API/DeviceLightEvent +tags: + - API + - Ambient Light Events + - Experimental + - Interface + - NeedsBetterSpecLink + - NeedsMarkupWork + - 事件 +translation_of: Web/API/DeviceLightEvent +--- +
{{apiref("Ambient Light Events")}}{{SeeCompatTable}}
+ +

DeviceLightEvent 为 Web 开发人员提供来自光传感器或类似设备的、关于附近环境光水平的信息。例如,基于当前环境光水平调节屏幕的亮度,以便节省电量或提供更好的阅读性。

+ +

属性

+ +
+
{{domxref("DeviceLightEvent.value")}}
+
环境光的亮度,单位为 {{interwiki("wikipedia", "lux")}}。
+
+ +

示例

+ +
window.addEventListener('devicelight', function(event) {
+  console.log(event.value);
+});
+ +

规范

+ + + + + + + + + + + + + + + + +
规范状态备注
{{ SpecName('AmbientLight', '', 'Ambient Light Events') }}{{ Spec2('AmbientLight') }}Initial specification
+ +

浏览器兼容性

+ + + +

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

+ +

参见

+ + -- cgit v1.2.3-54-g00ecf