W3cubDocs

/Web APIs

ContentVisibilityAutoStateChangeEvent: ContentVisibilityAutoStateChangeEvent() constructor

The ContentVisibilityAutoStateChangeEvent() constructor creates a new ContentVisibilityAutoStateChangeEvent object instance.

Syntax

js

new ContentVisibilityAutoStateChangeEvent(type, options)

Parameters

type

A string representing the type of event. In the case of ContentVisibilityAutoStateChangeEvent this is always event.

options Optional

An object that contains the following properties:

skipped

A boolean, which is set to true if the user agent skips the element's contents, or false otherwise.

Examples

A developer would not use this constructor manually. A new ContentVisibilityAutoStateChangeEvent object is constructed when a handler is invoked as a result of the contentvisibilityautostatechange event firing.

js

canvasElem.addEventListener("contentvisibilityautostatechange", (event) => {
  // …
});

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
ContentVisibilityAutoStateChangeEvent 108 108 110 No 94 No 108 108 No 73 No 21.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ContentVisibilityAutoStateChangeEvent/ContentVisibilityAutoStateChangeEvent