--- title: window.ondevicelight slug: Web/API/Window/ondevicelight tags: - Ambient Light - B2G - Firefox OS - WebAPI - Window translation_of: Web/API/Window/ondevicelight ---
{{ApiRef}} {{obsolete_header}}
デバイスの環境光センサが光の強度の変化を検出した際に発生する {{event("devicelight")}} イベントを受け取るイベントリスナーを指定します。
window.ondevicelight = funcRef
funcRef
: {{event("devicelight")}} イベント発生時に呼び出す関数への参照。 このイベントは {{domxref("DeviceLightEvent")}} のひとつです。仕様書 | 策定状況 | コメント |
---|---|---|
{{SpecName('AmbientLight', '#event-handlers', 'Ambient Light Events')}} | {{Spec2('AmbientLight')}} | 最初期の定義 |
{{Compat("api.Window.ondevicelight")}}