Resize popup window from the main window page after opening it - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window open

Description

Resize popup window from the main window page after opening it

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {// ww  w . j av  a  2  s.  c  o m
var newwindow=null;
test=function (){
  newwindow=window.open("http://java2s.com",'name','height=200,width=650,top=300,left=100');
  setTimeout(resize_now, 4000);
}
function resize_now(){
   newwindow.moveTo(100,100);
   newwindow.resizeTo(800, 800);
}

    });

      </script> 
   </head> 
   <body> 
      <a href="#" onclick="test()">click</a>  
   </body>
</html>

Related Tutorials