PopUp Sized to Fit Resolution

[Total: 0    Average: 0/5]

Automatically creates a popup window sized to fit on any resolution perfectly includes window properties and focus.

Head Code:

<script type="text/javascript">
{var win= null;
function NewWindow(url,name,scroll){
  var w = (screen.width-12);
  var h = (screen.height-55);
  var settings  ='height='+h+','; 
      settings +='width='+w+',';
      settings +='top='+0+',';
      settings +='left='+0+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=yes';
  win=window.open(url,name,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
 }
}
</script>

Body Code:

<a href="javascript:NewWindow('http://www.js-examples.com/','test','no');">click here to see the example</a>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *