A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/contextrestored_event below:

HTMLCanvasElement: contextrestored event - Web APIs

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("contextrestored", (event) => { })

oncontextrestored = (event) => { }
Event type

A generic Event.

Example

The code fragment below detects the context restored event.

const canvas = document.getElementById("canvas");

canvas.addEventListener(
  "contextrestored",
  (e) => {
    console.log(e);
    // call to redrawCanvas() or similar
  },
  false,
);
Specifications Browser compatibility

Loading…

See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4