diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/devicelightevent/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/devicelightevent/index.html')
-rw-r--r-- | files/zh-cn/web/api/devicelightevent/index.html | 61 |
1 files changed, 61 insertions, 0 deletions
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 +--- +<div>{{apiref("Ambient Light Events")}}{{SeeCompatTable}}</div> + +<p><code>DeviceLightEvent</code> 为 Web 开发人员提供来自光传感器或类似设备的、关于附近环境光水平的信息。例如,基于当前环境光水平调节屏幕的亮度,以便节省电量或提供更好的阅读性。</p> + +<h2 id="属性">属性</h2> + +<dl> + <dt>{{domxref("DeviceLightEvent.value")}}</dt> + <dd>环境光的亮度,单位为 {{interwiki("wikipedia", "lux")}}。</dd> +</dl> + +<h2 id="示例">示例</h2> + +<pre class="brush: js">window.addEventListener('devicelight', function(event) { + console.log(event.value); +});</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + <th scope="col">备注</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{ SpecName('AmbientLight', '', 'Ambient Light Events') }}</td> + <td>{{ Spec2('AmbientLight') }}</td> + <td>Initial specification</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + + + +<p>{{Compat("api.DeviceLightEvent")}}</p> + +<h2 id="参见">参见</h2> + +<ul> + <li>{{ event("devicelight") }}</li> + <li><a href="/zh-CN/docs/WebAPI/Using_Light_Events">使用环境光事件</a></li> +</ul> |