title: How to detect when a FullScreen event happens,on f11 key press
body: <p>How to detect when a FullScreen event happens,on f11 key press. if it happens that means,the screen is in FullScreen mode then show an alert.Not using keycode comparison.Plz give me a different way to do this.</p>
  
  <pre><code>// mozilla proposal
  element.requestFullScreen();
  document.cancelFullScreen(); 
  
  // Webkit (works in Safari and Chrome Canary)
  element.webkitRequestFullScreen(); 
  document.webkitCancelFullScreen(); 
  
  // Firefox (works in nightly)
  element.mozRequestFullScreen();
  document.mozCancelFullScreen(); 
  
  // W3C Proposal
  element.requestFullscreen();
  document.exitFullscreen();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>element.addEventListener('fullscreeneventchange', function(e) {
      if (document.fullScreen) {
         /* make it look good for fullscreen */
      } else {
         /* return to the normal state in page */
      }
  }, true);
  </code></pre>