[Javascript] Resizing browser window

Troy III Ajnej trojani2000 at hotmail.com
Thu Jul 27 11:13:46 CDT 2006


Hi, Geoff
Since I'm not making any money lately, I'll try making giveaways! 
This code is supposed to do the work.
*Win OS: IE, FX guarantied, you test it in Safari and let us know.
 
<HTML><HEAD><TITLE>WIDTH ADJUST</TITLE><style></style></HEAD>  <BODY SCROLL=Auto>    <DIV> Get adjusted "window width" fit desired "page width".    </DIV>  </BODY><SCRIPT>
var viewport=512 //change to your desired valuevar curBrowser=window.navigator.appName
 
    if(curBrowser.length>8){ curBrowser = curBrowser.slice(curBrowser.length-8)  }//  alert(curBrowser)
var scrlbar, yes = 16, no = 0;
 
var actual = document.body;
    if (actual.scrollHeight > actual.clientHeight){//  alert("scrollbars needed")  scrlbar = yes  }    else{//  alert("scrollbars not needed")  scrlbar = no  }
 
var BR = new Object()  BR.Explorer = 12  BR.Netscape = 8 //firefox, Safari  BR.Opera    = 14//Although Opera & Navigator r currently not supprting "resizeTo()"
 
var frame = eval("BR."+curBrowser)
var newWidth = viewport + frame + scrlbar
 
window.resizeTo(newWidth, screen.availHeight); window.moveTo(0,0)//  alert(newWidth)
 
</SCRIPT></HTML>
P.S.:This algo&code approach is fully original. Place it at the bottom of your other scripts to make sure it works properly.
Regards.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                         Troy III                           progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


From: geoffreyk at seanet.comTo: javascript at LaTech.eduSubject: RE: [Javascript] Resizing browser windowDate: Tue, 25 Jul 2006 07:27:43 -0700








Thanks Troy,
This may help if I can’t find a more direct way of getting these measurements or accomplishing my goal in another manner.
Really I am hoping to find some sort of property that I can query to get these values on the fly or a different way to resize a window.
 
Thanks though, I very well may end up using these values
 
-Geoff
 




_________________________________________________________________
Try Live.com - your fast, personalized homepage with all the things you care about in one place.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060727/ea9d2ee2/attachment.htm>


More information about the Javascript mailing list