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

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
skipped

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Siehe auch