diff options
Diffstat (limited to 'files/zh-cn/orphaned/web/api/devicelightevent/index.html')
-rw-r--r-- | files/zh-cn/orphaned/web/api/devicelightevent/index.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/files/zh-cn/orphaned/web/api/devicelightevent/index.html b/files/zh-cn/orphaned/web/api/devicelightevent/index.html new file mode 100644 index 0000000000..e3e717c514 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/devicelightevent/index.html @@ -0,0 +1,62 @@ +--- +title: DeviceLightEvent +slug: orphaned/Web/API/DeviceLightEvent +tags: + - API + - Ambient Light Events + - Experimental + - Interface + - NeedsBetterSpecLink + - NeedsMarkupWork + - 事件 +translation_of: Web/API/DeviceLightEvent +original_slug: 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> |