LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG-Webdev] Resizing windows

[ILUG-Webdev] Resizing windows

Niall O Broin niall at linux.ie
Tue Mar 11 15:00:02 GMT 2003


On Tuesday 11 March 2003 14:27, you wrote:

> > self.resizeTo(<?=$w?>, <?=$h?>);
> >
> > which will work just fine in that it will resize the window to the size I
> > specify
>
> No it won't Niall, because NN and IE have (had) different viewpoints on

With respect, my dear, it does, because it's what I'm using currently. This is 
from the production code

function resize() {
// Automatically resize the window to best-fit - only works with Navigator
        if (document.layers) {
                window.innerHeight = document.height + 20;
                window.innerWidth = document.width;
                if (window.innerHeight > screen.availHeight - 30) {
                window.innerHeight = screen.availHeight - 30;
                // Allow for width of scrollbar
                window.innerWidth = document.width + 20;
                }
        } else {
                self.resizeTo(my_width, my_height);
        }
}

and it works fine on NS4, Moz 1.2 and IE 5.5. 

> > but that's no advance on what I already have. I need to
> > be able to ask:
> >
> > Now that this document has been rendered, what are the dimensions
> > of the box which would just contain it ?
> >
> > Resize the window to those dimensions.
>
> Obviously I was just resizing to an image, but this should give you a
> start:

That's the point. You had what seems to me a somewhat longwinded way of 
resizing to known dimensions, as compared to what I do above.

> http://www14.brinkster.com/lloydh/dynlib/demos/layerdimensions.html

I had a quick look there, and hopefully it may be of some help.

> check dims and resize accordingly. You'll still need to do the initial
> resizeTo(100,100) if you want to support IE though. :)

I don't understand what this is about - I don't seem to need it. Perhaps what 
you mean is that before doing the initial resizeTo, the values returned by 
self.document.body.client[Width|Height] are not meaningful.


Niall



More information about the Webdev mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell