title: Triggering full screen in browser with JavaScript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1125084/how-to-make-in-javascript-full-screen-windows-stretching-all-over-the-screen">How to make in Javascript full screen windows (stretching all over the screen)</a>  </p>
  </blockquote>
  
  
  
  <p>Currently I tried to do something like, when you click a fullscreen button current window will become full screen. I tried to use the following script, but it doesn't work. Any ideas on how to make this work?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  window.onload = maxWindow;
  
  function maxWindow() {
      window.moveTo(0, 0);
  
      if (document.all) {
          top.window.resizeTo(screen.availWidth, screen.availHeight);
      }
      else if (document.layers || document.getElementById) {
          if (top.window.outerHeight &lt; screen.availHeight || top.window.outerWidth &lt; screen.availWidth) {
              top.window.outerHeight = screen.availHeight;
              top.window.outerWidth = screen.availWidth;
          }
      }
  }
  &lt;/script&gt;
  </code></pre>