visibilitychange

visibilitychange 이벤트는 브라우저 탭의 컨텐츠가 visible 또는 hidden 상태로 변화할 때 발생된다.

Bubbles Yes
Cancelable No
Interface event
Event handler property onvisibilitychange (en-US)

예제

document.addEventListener("visibilitychange", function() {
  console.log( document.visibilityState );
});

명세

Specification Status Comment
Page Visibility (Second Edition)
The definition of 'visibilitychange' in that specification.
Recommendation  

브라우저 호환성

No compatibility data found for api.Document.visibilitychange.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.

같이 보기