Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 14th, 2004, 12:08 PM
Registered User
 
Join Date: Jan 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Resizing the document area

Does anyone know if it is possable using javascript (or other method) to set the INTERNAL dimensions of the browser? eg my web site is exactly 800*600 and does not streach to fill extra space and I want to resize the browser to show it with no extra space beside or below. Using Window.resiseto(800,600) sets the outer size of the browser and hence the space left to display the page contents is much less than that. I could allow for that but if there are diferent sized toolbars etc on diferent browsers then I am back where I started.

Any sugestions apreciated.

Thanks
 
Old January 14th, 2004, 01:17 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Better if your page adjusted for the screen but you could use screen.availWidth and screen.availHeight (IE only I think).
There are so many width/height measures I get confused...

http://msdn.microsoft.com/library/de...ence_entry.asp



--

Joe
 
Old January 16th, 2004, 09:36 AM
Registered User
 
Join Date: Jan 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply joefawcett :-) Will try some of that. I agree with having a site that resizes and I normaly do but in this instance I thought I had a good reason not to. Turns out I might be able to rezise my site after all.
 
Old February 2nd, 2004, 01:20 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Place the following script in the <HEAD> </HEAD> tag of the document you want to be full screen size. It will open the document to full screen size.


<script language="JavaScript1.2">
<!--

/*
Auto Maximize Window Script- By Nick Lowe ([email protected])
For full source code, 100's more free DHTML scripts, and Terms Of Use
Visit http://www.dynamicdrive.com
*/

top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.avail Height);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.wi ndow.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
//-->
</script>

-------------------------------------------------------
Quote:
quote:Originally posted by benburrows
 Does anyone know if it is possable using javascript (or other method) to set the INTERNAL dimensions of the browser? eg my web site is exactly 800*600 and does not streach to fill extra space and I want to resize the browser to show it with no extra space beside or below. Using Window.resiseto(800,600) sets the outer size of the browser and hence the space left to display the page contents is much less than that. I could allow for that but if there are diferent sized toolbars etc on diferent browsers then I am back where I started.

Any sugestions apreciated.

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing Forms Apocolypse2005 Beginning VB 6 6 April 20th, 2007 05:43 PM
Resizing Images san123 ASP.NET 1.0 and 1.1 Basics 2 April 26th, 2006 02:51 PM
Need Help with Resizing... alaamri HTML Code Clinic 3 August 29th, 2005 01:54 AM
Resizing form dotnetprogrammer VS.NET 2002/2003 0 February 23rd, 2005 02:58 AM
Resizing a dropdownlist Hussam_ahmad VS.NET 2002/2003 0 May 11th, 2004 06:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.