Open maximized, full screen window with Javascript - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window open

Description

Open maximized, full screen window with Javascript

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <button onclick="openPopup()"> Open maximized popup </button> 
      <script type="text/javascript">
function openPopup()//w  w  w.  j  a  v a  2s .com
{
   var popup = window.open("/", "popup", "fullscreen");
  if (popup.outerWidth < screen.availWidth || popup.outerHeight < screen.availHeight)
  {
     popup.moveTo(0,0);
     popup.resizeTo(screen.availWidth, screen.availHeight);
  }
}

      </script>  
   </body>
</html>

Related Tutorials