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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 33
Full support 33
Full support 13
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support YesFirefox Full support 56IE Full support 10Opera Full support 12.1
Notes
Full support 12.1
Notes
Notes Doesn't fire the visibilitychange event when the browser window is minimized, nor when hidden is set to true.
Safari Full support 7WebView Android Full support 4.4.3Chrome Android Full support 33Edge Mobile Full support YesFirefox Android Full support 56Opera Android Full support 12.1
Notes
Full support 12.1
Notes
Notes Doesn't fire the visibilitychange event when the browser window is minimized, nor when hidden is set to true.
Safari iOS Full support 7Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

Autorzy i etykiety dokumentu

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