Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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();
  }
});
Comment

JS exit fullscreen

document.exitFullscreen();
Comment

PREVIOUS NEXT
Code Example
Javascript :: reactjs .htaccess 
Javascript :: redux devtools with middleware 
Javascript :: chartjs bar chart hover color 
Javascript :: how to change a css variable with javascript 
Javascript :: jquery css add important 
Javascript :: remove all options from select jquery 
Javascript :: js mouse position relative to element 
Javascript :: set attribute checked jquery 
Javascript :: sequelize order by date 
Javascript :: how to make an alphabet in javascript 
Javascript :: jquery submit form via ajax 
Javascript :: angular go to route 
Javascript :: one year ago javascript date 
Javascript :: javascript urlencode json 
Javascript :: joi phone number validation 
Javascript :: three js clock 
Javascript :: remove a special character from string javascript 
Javascript :: Javascript get random item from array 
Javascript :: document ready function 
Javascript :: npm create-react-app 
Javascript :: js remove undefined from array 
Javascript :: java.lang.outofmemoryerror (no error message) react native 
Javascript :: auto scroll to bottom of page js 
Javascript :: shorthand for document.ready 
Javascript :: jquery prevent event bubbling 
Javascript :: javascript array includes another array 
Javascript :: fibonacci sequence in javascript using for loop 
Javascript :: 419 unknown status ajax laravel 
Javascript :: jquery get form data 
Javascript :: discord.js get user by id 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =