“JS Exit FullScreen” Ответ

Event Exit FullScreen

document.getElementById('fullscreen-div').addEventListener('fullscreenchange', (event) => {
  // document.fullscreenElement will point to the element that
  // is in fullscreen mode if there is one. If not, the value
  // of the property is null.
  if (document.fullscreenElement) {
    console.log(`Element: ${document.fullscreenElement.id} entered fullscreen mode.`);
  } else {
    console.log('Leaving full-screen mode.');
  }
});

document.getElementById('toggle-fullscreen').addEventListener('click', (event) => {
  if (document.fullscreenElement) {
    // exitFullscreen is only available on the Document object.
    document.exitFullscreen();
  } else {
    document.getElementById('fullscreen-div').requestFullscreen();
  }
});
Foolish Fowl

JS Exit FullScreen

document.exitFullscreen();
Code Cat

Ответы похожие на “JS Exit FullScreen”

Вопросы похожие на “JS Exit FullScreen”

Больше похожих ответов на “JS Exit FullScreen” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования