[ILUG-Webdev] Resizing windows
adam beecher
lists at spamfilter.cc
Tue Mar 11 14:27:29 GMT 2003
> 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
windows. I can't remember the exact difference because it's a long time
since I wrote that code, but it comes down to outer and inner dimensions --
NN and IE see one and not the other. (Obviously this refers to the "old
days", but it still applies to relatively modern browsers. The DOM is the
holy grail, in both senses of the word, value and unattainability.)
Again, that's why the initial resize is required -- it provides IE with a
point of reference for the "proper" resize. If I can find a reference on the
above, I'll send it on later, but I spent quite an amount of time
researching this to be sure to be sure, and wrote the code myself. (Sans a
decent sniffer of course, but this was going in a popup windows, scale
needed consideration.)
> 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:
http://www14.brinkster.com/lloydh/dynlib/demos/layerdimensions.html
Obviously you'll need to step up to the lib there to get full code, but when
you have it you should be able to pop your window, render the layer, check
dims and resize accordingly. You'll still need to do the initial
resizeTo(100,100) if you want to support IE though. :)
adam
More information about the Webdev
mailing list