Re: Making window fit contents in all browsers?



Dr J R Stockton said the following on 4/21/2007 5:53 PM:
In comp.lang.javascript message <qvKdnfjCHvFsBbTb4p2dnA@xxxxxxxxxxxx>,
Sat, 21 Apr 2007 00:55:03, Randy Webb <HikksNotAtHome@xxxxxxx> posted:
Dr J R Stockton said the following on 4/19/2007 11:39 AM:
In comp.lang.javascript message <lcCdnd2J5NIyBbvb4p2dnA@xxxxxxxxxxxx>,
Wed, 18 Apr 2007 18:17:05, Randy Webb <HikksNotAtHome@xxxxxxx> posted:
Dr J R Stockton said the following on 4/17/2007 2:20 PM:
I want page <URL:http://www.merlyn.demon.co.uk/js-quick.htm> to open, in
IE6, IE7, Firefox 2, and wherever else practicable, with the control
labelled F.X0 fully visible at the top of the window and the control
F.Result (which is just under the textarea) fully visible at the bottom
of the window.
What's the right, or best, way to do that?
Ask the user to resize the window. Otherwise it is anti-social behavior
at best. And, resizing windows can be explicitly disabled in Mozilla
based browsers.
Don't be dictatorial.
Hmmm. Let me think this out here now. You want to force a browser
window size onto your users. Yet you call me "dictatorial" for telling
you it was a bad idea. Interesting line of thought you have sometimes.

If you had read the page,

Missing > - I wrote those six words.

You know, as well as anybody else here, that a Usenet post should stand
on its own merits without having to resort to reading a webpage in
order to understand a question you pose here, unless it states in your
post (which it didn't) that the question was further explained in the
page.

And, you might want to add "opened and " after the third word of that
sentence.

Undefined : "that".

"that" = The sentence that starts with "If you had read the page".

you would have realised that it is primarily for my own use,
Again, you are assuming - incorrectly - that I even opened the page,
much less read it. The onus is on you, as the OP, to explain your
question, it is not up to me to guess what your intentions are.

No : "If you had read the page," expresses a possibility but not an
expectation. It's the sort of thing that a reasonable person would do
before commenting about whether re-sizing and scrolling was appropriate
for the page in question.

No, as it is *never* "appropriate" to resize a users browser window without explicit permission and simply opening a page does not give that permission.

But, in order to answer the question as I asked it, there was no real
need to visit the page, although that might have helped.

Precisely and I didn't open the page. Hence my suggestion to add "opened and " to "that" sentence.

Of course, in the ordinary commercial environment, resizing larger is
arrogance and forces the ordinary reader to accept something unwanted.

Resizing at all, whether larger or smaller, is ignorant arrogance. Which is what lead you to call me "dictatorial" yet now you are agreeing with me. Interesting.

and secondarily for others to copy and adapt if they wish. If they
don't like what it does, the remedy is in their hands.
Yes, and it involves leaving the site and not returning.

If they wish, yes. It's primarily for my own use, both locally and
remotely. In fact, as I say on the page, I don't *want* people to use
it much, but to use a copy instead.

Again, what you say on the page itself is irrelevant as you have already resized the browser, without permission, before a person even has a change to read the page.

I use the page so often (locally) that it would really be convenient to
have it always set itself to show just what I want - which in any case
is what any regular user of a copy would want - and it's much easier to
remove such a feature than to add it.
You seem to know, before asking, what anybody else wants, and you call
me dictatorial. Interesting.

Indeed, the design of the page is such that I do know what they will
want when visiting the page, unless they visited it in error.

Are you a mind reader now? You must be if you can claim to know what a visitor wants before visiting.

The rest of the material on it is only for reference, and will be read
infrequently. If you had visited the page, you would have realised
that.

Again, the content of the page is irrelevant to your question.

Additional : in FF2, as well as the tabs encroaching on the target area,
I think the FIND bar also does so.

You know the canvas height and width you want it to display it.

No, I do not. I know the internal height of the textarea in characters,
and the width in percent, but I don't know the size of F in pixels. F
contains other controls.

Size the window the size you want it. Then, you read the canvas height and width. Then you know F in pixels. FAQ 4.9 has code to determine the canvas area. That canvas size will be fixed. Call them desiredCanvasHeight and desiredCanvasWidth. Then, onload/onresize of the page, you read the current canvasHeight and current canvasWidth. Whatever the difference in the two sizes, you know you have to resize the window by that many pixels. Then you read the window height/width and resize it accordingly. Then it won't matter what toolbars/tabs or anything else is showing, you get the canvas area you are after. The onresize could be tricky as it may or may not get fired if tabs cause the canvas area to be slightly smaller, you would have to test it.

What you do on your own PC is your own business. Trying to force a
browser window size on a web site is irresponsible behavior of a web
author. I am pretty sure Alan has said that before.

Do you mean the late Alan? Or one who posts here?

The late Alan.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.



Relevant Pages

  • Re: Drawing in CHtmlView
    ... represent the other person's cursor, so this cursor is what I want to draw ... other person's browser. ... All the drawing is done by and in that control. ... In order to draw something in that window you will have to replace that ...
    (microsoft.public.vc.mfc)
  • Re: Drawing in CHtmlView
    ... represent the other person's cursor, so this cursor is what I want to draw ... other person's browser. ... All the drawing is done by and in that control. ... In order to draw something in that window you will have to replace that ...
    (microsoft.public.vc.mfc)
  • Re: Webbrowser control looses sessionid on "newwindow"
    ... I do not have control over the web page. ... are errors then they are output to the window). ... instance of the webbrowser control), ... I haven't gone to the trouble of creating a beresque browser to test your ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: How to bring ActiveX to top?
    ... >>I have an application that runs as an ActiveX control within a browser ... >>window in question, or perhaps minimised it. ... >>program I need to bring the browser window containing the control to the ...
    (comp.lang.pascal.delphi.misc)
  • Re: Entwicklung von Unix-Anwendung mit C++ (m/w)/ NRW : Ref.-Nr.: 37302/1
    ... I am responsible for design and implementation of the persistent data server working with mySQL. ... Developed within very short time the product was successfully installed ... Reengineering and implementing a display tool for Experimental Physics Industrial Control System ... Developed an operator interface under X Window for High Energy Physics Accelerator Control System. ...
    (de.markt.arbeit.d)