Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

screenfull angular example

/**
   * Toggles the fullscreen mode.
   */
  toggleFullscreen() {
    if (document.webkitIsFullScreen) {
      this._exitFullscreen();
    } else {
      this._activateFullscreen();
    }
  }

  /**
   * Activate Full Screen Mode.
   */
  private _activateFullscreen() {
    let fullscreenElement = document.documentElement;
    if (fullscreenElement.requestFullscreen) {
      fullscreenElement.requestFullscreen();
    } else if (fullscreenElement.mozRequestFullScreen) { 
      /* Firefox */
      fullscreenElement.mozRequestFullScreen();
    } else if (fullscreenElement.webkitRequestFullscreen) { 
      /* Chrome, Safari and Opera */
      fullscreenElement.webkitRequestFullscreen();
    } else if (fullscreenElement.msRequestFullscreen) { 
      /* IE/Edge */
      fullscreenElement.msRequestFullscreen();
    }
  }

  /**
   * Exits Full Screen Mode.
   */
  private _exitFullscreen() {
    if (document.exitFullscreen) {
      document.exitFullscreen();
    } else if (document.mozCancelFullScreen) { 
      /* Firefox */
      document.mozCancelFullScreen();
    } else if (document.webkitExitFullscreen) { 
      /* Chrome, Safari and Opera */
      document.webkitExitFullscreen();
    } else if (document.msExitFullscreen) { 
      /* IE/Edge */
      document.msExitFullscreen();
    }
  }
Comment

PREVIOUS NEXT
Code Example
Javascript :: Producing a Promise 
Javascript :: how to get mobile preferences is it dark or light using javascript 
Javascript :: Message on a kendo loader 
Javascript :: js log without newline 
Javascript :: organize api calls react native folder 
Javascript :: angular cannot access event.target.value of input element using $event 
Javascript :: how to pass function arguments without invoke the function 
Javascript :: Process.ChildProcess._handle.onexit 
Javascript :: jest check the link of a button 
Javascript :: javascript copy input value to clipboard on click 
Javascript :: next js global layout 
Javascript :: jquery slick remove white fade 
Javascript :: JavaScript object numeric keys 
Javascript :: isnumber javascript function 
Javascript :: react movies 
Javascript :: ist to gmt javascript 
Javascript :: use variable in form action vuejs 
Javascript :: add codegrepper 
Javascript :: javascript unique id 
Javascript :: jquery scroll to top of element 
Javascript :: Mutations 
Javascript :: runecape 
Javascript :: comparing oblects 
Javascript :: angular pass template value from component 
Javascript :: js invert array 
Javascript :: reduce tally 
Javascript :: count how many times elements in an array are repeated javascript 
Javascript :: get nearest to user location js 
Javascript :: how to merge data rn 
Javascript :: jquery ui music player 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =