Document.onvisibilitychange

Nasi wolontariusze nie przetłumaczyli jeszcze tego artykułu na język Polski. Dołącz do nas i pomóż go przetłumaczyć!
Można także przeczytać artykuł w języku: English (US).

The Document.onvisibilitychange property represents the event handler that is called when a visibilitychange event reaches this object.

Syntax

obj.onvisibilitychange = function;
  • function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration.

Example

document.onvisibilitychange = function() { 
  console.log("Visibility of page has changed!");
}; 

Specifications

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

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support

33

13 webkit

Yes561012.117
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support3333 Yes5612.117 ?

1. Doesn't fire the visibilitychange event when the browser window is minimized, nor when hidden is set to true.

See also

Autorzy i etykiety dokumentu

Autorzy tej strony: fscholz, jpmedley, chrisdavidmills
Ostatnia aktualizacja: fscholz,