ContentVisibilityAutoStateChangeEvent: Eigenschaft skipped
Die schreibgeschützte Eigenschaft skipped
der ContentVisibilityAutoStateChangeEvent
-Schnittstelle gibt true
zurück, wenn der Benutzeragent den Inhalt des Elements überspringt, oder false
, wenn nicht.
Wert
Ein Boolean. Gibt true
zurück, wenn der Benutzeragent den Inhalt des Elements überspringt, oder false
andernfalls.
Beispiele
js
const canvasElem = document.querySelector("canvas");
canvasElem.addEventListener("contentvisibilityautostatechange", stateChanged);
canvasElem.style.contentVisibility = "auto";
function stateChanged(event) {
if (event.skipped) {
stopCanvasUpdates(canvasElem);
} else {
startCanvasUpdates(canvasElem);
}
}
// Call this when the canvas updates need to start.
function startCanvasUpdates(canvas) {
// …
}
// Call this when the canvas updates need to stop.
function stopCanvasUpdates(canvas) {
// …
}
Spezifikationen
Specification |
---|
CSS Containment Module Level 2 # dom-contentvisibilityautostatechangeevent-skipped |
Browser-Kompatibilität
BCD tables only load in the browser
Siehe auch
- Das
contentvisibilityautostatechange
Ereignis - CSS Containment
- Die
content-visibility
Eigenschaft - Die
contain
Eigenschaft