Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Handling Fullscreen Events | Clipboard and Fullscreen Features
JavaScript Web APIs Essentials

bookHandling Fullscreen Events

index.html

index.html

style.css

style.css

script.js

script.js

copy

When you use the Fullscreen API, you might want your page to react whenever the user enters or exits fullscreen mode. The fullscreenchange event lets you detect these changes. In the example above, the code adds event listeners for both fullscreenchange and fullscreenerror. When the fullscreenchange event fires, the button label updates to reflect the current fullscreen state, and a message displays to show whether fullscreen mode was entered or exited. This makes the user interface more responsive and clear. If something goes wrong, the fullscreenerror event displays an error message so users know what happened. By using these events, you can keep your UI in sync with the actual fullscreen state, giving users a seamless experience.

question mark

What is the purpose of the 'fullscreenchange' event in the Fullscreen API?

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 4

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

bookHandling Fullscreen Events

Veeg om het menu te tonen

index.html

index.html

style.css

style.css

script.js

script.js

copy

When you use the Fullscreen API, you might want your page to react whenever the user enters or exits fullscreen mode. The fullscreenchange event lets you detect these changes. In the example above, the code adds event listeners for both fullscreenchange and fullscreenerror. When the fullscreenchange event fires, the button label updates to reflect the current fullscreen state, and a message displays to show whether fullscreen mode was entered or exited. This makes the user interface more responsive and clear. If something goes wrong, the fullscreenerror event displays an error message so users know what happened. By using these events, you can keep your UI in sync with the actual fullscreen state, giving users a seamless experience.

question mark

What is the purpose of the 'fullscreenchange' event in the Fullscreen API?

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 4
some-alt