Answers for "fullscreen div"

0

body width full

body {
    min-width: fit-content;
}
Posted by: Guest on August-14-2020
3

make a div full screen css

height: 100vh
Posted by: Guest on July-27-2020
0

make div fullscreen

div {position: absolute; top: 0; right: 0; bottom: 0; left: 0;}
Posted by: Guest on June-26-2021
1

full screen a div

$('#toggle_fullscreen').on('click', function(){
  // if already full screen; exit
  // else go fullscreen
  if (
    document.fullscreenElement ||
    document.webkitFullscreenElement ||
    document.mozFullScreenElement ||
    document.msFullscreenElement
  ) {
    if (document.exitFullscreen) {
      document.exitFullscreen();
    } else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen();
    } else if (document.webkitExitFullscreen) {
      document.webkitExitFullscreen();
    } else if (document.msExitFullscreen) {
      document.msExitFullscreen();
    }
  } else {
    element = $('#container').get(0);
    if (element.requestFullscreen) {
      element.requestFullscreen();
    } else if (element.mozRequestFullScreen) {
      element.mozRequestFullScreen();
    } else if (element.webkitRequestFullscreen) {
      element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
    } else if (element.msRequestFullscreen) {
      element.msRequestFullscreen();
    }
  }
});
Posted by: Guest on July-06-2020

Browse Popular Code Answers by Language