ContentVisibilityAutoStateChangeEvent: ContentVisibilityAutoStateChangeEvent() constructor
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
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
ContentVisibilityAutoStateChangeEventthis is alwaysevent. optionsOptional-
An object that contains the following properties:
skipped-
A boolean, which is set to
trueif the user agent skips the element's contents, orfalseotherwise.
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
| Specification |
|---|
| CSS Containment Module Level 2 # dom-contentvisibilityautostatechangeevent-contentvisibilityautostatechangeevent |
Browser compatibility
| desktop | mobile | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
ContentVisibilityAutoStateChangeEvent() constructor | |||||||||||
See also
- The
contentvisibilityautostatechangeevent - CSS Containment
- The
content-visibilityproperty - The
containproperty