Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 Javascript Articles

Sometimes we want to be able to change the size of the browser window, based on the content which we are showing.  Perhaps we wish to show the website in a letter box style or we wish to have a common popup up window be be able to size it for the current purpose. The code provided below may be used to resize the browser window, without setting the size within the window.open command.

function resizeWindow (screenW, screenH) {
  if (parseInt(navigator.appVersion)>3) {
     screenW = screen.width;
     screenH = screen.height;
   }
  else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled() ) {
    var jToolkit = java.awt.Toolkit.getDefaultToolkit(); var jScreenSize = jToolkit.getScreenSize();
    screenW = jScreenSize.width;
    screenH = jScreenSize.height;
  }
  window.resizeTo(screenW ,screenH );
}

Call the function using the command

resizeWindow(400,300)

Don't forget to incoporate this command either in the tag using the onload parameter, or directly in the header with the function.


This article viewed: 1325 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Tuesday, May 13, 2008