Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende 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

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 4

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain how to add these event listeners in JavaScript?

What browsers support the Fullscreen API and these events?

Are there any accessibility considerations when using fullscreen mode?

bookHandling Fullscreen Events

Desliza para mostrar el menú

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

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 4
some-alt