The ongoing new-window Resize debate

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Hayes

    #1

    The ongoing new-window Resize debate

    juglesh <juglesh@nospam RadioKDUG.com> wrote in "Re: how to maximize the
    browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12
    AM):[color=blue]
    > [...][color=green]
    > >I want to maximize the browser window when I open a new window.[...][/color]
    >
    > function expand() {
    > window.moveTo(0 ,0);
    > window.resizeTo (screen.availWi dth, screen.availHei ght);
    > }[/color]

    I like availWidth and availHeight, but I'd much rather work with
    window.availWid th and window.availHei ght. Unfortunately, they just aren't
    universally available. When I ran a function to see which ones were
    available, most weren't. I tried:

    alert("window.w idth: " + window.width + "\n" +
    "window.availWi dth: " + window.availWid th + "\n" +
    "screen.wid th: " + screen.width + "\n" +
    "screen.AvailWi dth: " + screen.AvailWid th + "\n" +
    "window.innerWi dth: " + window.innerWid th + "\n" +
    "screen.innerWi dth: " + screen.innerWid th + "\n");

    What I got was:
    window.width: undefined
    window.availWid th: undefined
    screen.width: 800
    screen.availWid th: 800
    window.innerWid th: undefined
    screen.innerWid th: undefined

    If one could place images, columns, etc., on the basis of the browser's
    current WINDOW.width rather than screen.availWid th, everyone could be happy.
    Yet, having as I do Internet Explorer 5.5 (and Netscape 4.6) (this isn't an
    exhaustive list: this is what I use for most tests), running on Windows ME,
    I can say that whatever problems I brought on myself by not having the most
    up-to-date versions, I'm at least replicating the conditions of a multitude
    of potential visitors, so many of whom haven't upgraded in recent years
    either.

    Grant Wagner <gwagner@agrico reunited.com> responded (Thursday, January 06,
    2005 1:53 PM):[color=blue]
    > [after quoting above code:]
    > - Does not do anything in Gecko-based browsers appropriately configured
    > - Results in an MDI window that is both too tall and too wide in Opera
    > 7.54u1
    > - Results in a window that is actually wider and taller than
    > screen.availWid th/Height in Netscape 4 (because resizeTo() resizes the
    > window's viewport, not it's outter dimensions)
    > - Annoys the user when it does work, since they probably had their
    > browser the size they wanted it[/color]

    Noozer" concurred (Saturday, January 01, 2005 12:59 AM):[color=blue]
    > 1) Don't touch my browser size. I'm quite capable of resizing the window[/color]
    if[color=blue]
    > I need to.
    >
    > 2) Don't open a new window. Your site has a browser window, ONE is all you
    > get. Make good use of it.[/color]

    So did Sid Ismail (Saturday, January 01, 2005 7:53 AM):[color=blue]
    > Don't open a new window. Don't maximise. Do not pass Go.
    >
    > It's _my_ browser.[/color]

    There are valid concerns here, but they can be overcome. One window is not
    the ideal for some material when the user knows that the content of the new
    window is just a side point and that he likely will return to the first
    page. Think of the sites where you are invited to read a disclaimer, an
    explanation, a definition or a chart (perhaps shipping charges). Do you
    really want the new page to stay within the same window, with it coming with
    the worry that the form you may have filled out (radio buttons for a survey,
    street address for mail delivery of documentation, etc.) may be blank when
    you return to this page? Pop-ups eliminate this worry, because the content
    of the first window stays as it is until one returns and deliberately
    effects a change.

    (There's a lot to be said here for putting a note next to the link on the
    first page: "will appear in a new window.")

    I take it to be a responsibility that I not abuse screen.availWid th,
    ..availHeight. What I do in my window.open comment is not specify
    "width=800,heig ht=600" but use variables for the width and height of the new
    window. And these variables are filled not by merely the results of getting
    screen.availWid th, .availHeight, but of subtracting sufficient pixels. If
    my variable is filled by "screen.availWi dth - 90," I know that I am leaving
    sufficient space at the bottom of the screen for the user to see his
    taskbar. (I take it for granted that I also use "window.moveTo( 0,0)" so
    that buffer space at the top and left of the new browser window doesn't
    crowd the bottom and right sides off the screen.)

    Fred Oz <ozfred@iinet.n et.auau> brought up another point (Saturday, January
    01, 2005 5:43 AM)[color=blue]
    > [...] users were so pissed
    > off with windows opening full screen that browser makers removed the
    > ability for programmers to do it. Many browsers also allow the user to
    > stop JavaScript from resizing or moving windows.
    >
    > New windows, by default in most browsers, open to the same size as the
    > current window. So users with full-screen windows will not notice you
    > setting your new window to full screen, whereas those with their
    > browsers set smaller will. Consider someone with a large monitor of
    > say 2560x1600. Or maybe with one desktop spread over two monitors. Do
    > you really think they want your window over their entire desktop?[/color]

    Here, too, a responsible programmer doesn't let "screen.availWi dth - 90"
    (and its availHeight counterpart) end his settings. By setting a maximum
    for the variable (if screenHght > 1200 {screenHght == 1200}), one doesn't
    force these problems on the user. Quite apart from the problem of a desktop
    spread over two monitors, it's just common sense that text becomes difficult
    to read when the lines are too wide. Never mind that the user doesn't have
    to scroll left and right -- if the line is so wide on a two-foot-wide screen
    that the reader needs a straight edge sheet of paper to help him keep his
    place, then the programmer has done a disservice.

    Grant Wagner knew of that from his own experience when he wrote (Tuesday,
    September 21, 2004 1:32 PM)(in "Re: resize browser window on load"):[color=blue]
    > [...] I was recently forced to work on a laptop with a 640 x 480 display.[/color]
    I can[color=blue]
    > not tell you how hostile most sites I visited were to that particular
    > resolution, let alone something smaller that you might find on a portable
    > device.[/color]

    I know too from my own business travels what it was like to regularly work
    (and have after-hours leisure) with a laptop with a 640 x 480 screen. One
    has to wonder who the programmers thought they were pleasing with attractive
    designs that were disfunctional. Sometimes if it wasn't just for a header
    ..GIF that spread past the edge of the screen (when the scroller wasn't set
    for the right side), the ASCII text wouldn't have been an obstacle course of
    constantly scrolling left and right.

    W.H. Olives offered a solution to the problem of placement in "Re: resize
    browser window on load" (Tuesday, September 21, 2004 12:50 PM):[color=blue]
    > I always start a new page and insert a 75% width table, aligned to center.
    > I then insert a 100% table with 2 columns (right margin) and a few rows,
    > into that one.
    >
    > This is exactly how YAHOO and GOOGLE's pages Load, like they'll fit[/color]
    anything[color=blue]
    > they encounter. I will never go back to all of that "detect[/color]
    browser/detect[color=blue]
    > resolution crap. Thank God for % width tables.[/color]

    I agree. I have achieved what I wanted in screen placement through a
    judicious use of a mix of tables, including embedded tables.

    arkascha wrote in "window resize to required size" (Wednesday, October 20,
    2004 9:24 AM)[color=blue]
    > [...] When choosing a fixed window size things look
    > silly most of the time. Either you have a nearly
    > empty window or you have to scroll all the time...
    >
    > So I want to resize the window. Resize it to what size? The size that is
    > required by the pages content when redered in the browser. That's all :-)
    >
    > -- hmmm -- I tried around quite a lot with scrollHeigths, offsetWidth and[/color]
    so[color=blue]
    > on, but there does not seem to be any more or less reliable solution.,
    > Especially not when trying to make stuff usable for different browsers.
    > Does anyone have a hint what else I can try, where I could look?[/color]

    As long as it will be the case that programmers are presenting images --
    which are almost by definition of fixed size (let's not think of how
    gruesome they look when they're blown up to fit an arbitrary amount of
    space) -- there is going to be the problem of blank space beyond which the
    designer chose not to place additional photographs lest the page become a
    scrolling nightmare on a 640-width monitor. (I use pop-ups for picture-rich
    pages for this reason, but set the width at no more than about 550, but
    often at less than that.)

    Summary statement: can JavaScript programmers accept judicious and
    responsible use of launching new windows and setting browser width?

    --
    David Hayes

    (remove the name of the programming language from email address to make it
    usable)










  • Mick White

    #2
    Re: The ongoing new-window Resize debate

    David Hayes wrote:
    [color=blue]
    > juglesh <juglesh@nospam RadioKDUG.com> wrote in "Re: how to maximize the
    > browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12
    > AM):
    >[color=green]
    >>[...]
    >>[color=darkred]
    >>>I want to maximize the browser window when I open a new window.[...][/color]
    >>
    >>function expand() {
    >>window.moveTo (0,0);
    >>window.resize To(screen.avail Width, screen.availHei ght);
    >>}[/color]
    >
    >
    > I like availWidth and availHeight, but I'd much rather work with
    > window.availWid th and window.availHei ght. Unfortunately, they just aren't
    > universally available. When I ran a function to see which ones were[/color]

    Window size != screen size.
    Mick

    Comment

    • Fred Oz

      #3
      Re: The ongoing new-window Resize debate

      David Hayes wrote:
      [...][color=blue]
      > Summary statement: can JavaScript programmers accept judicious and
      > responsible use of launching new windows and setting browser width?[/color]

      Limited and judicious use of pop-ups is OK for specialty sites like
      galleries, but web sites should be designed first and foremost to
      operate without any JavaScript or popups. JS should enhance the
      experience, not be the experience unless that is an express or closely
      related purpose of the site (say browser games). In all other cases,
      web pages must cater for users with JavaScript disabled and users with
      browsers that don't support it.

      Attempting to ensure your pop-up is reasonably sized is also a good
      idea - for assistance with your cross-browser issues, try:

      <URL:http://www.quirksmode. org/index.html?/viewport/compatibility.h tml>

      As for returning to a partially completed form, the flow of the site
      should be such that users don't have to leave a partially completed
      form to read a disclaimer or other important information. The
      corollary is that users don't always close the extra windows, they just
      click back on the main window (particularly users who surf with
      full-screen windows). The plethora of background popups that are
      likely to result can become a serious drain performance.

      Finally, have had the ability to open links in a new window themselves
      from the very early days. The "Back" button also helps here. Further,
      the increasing use of tabs makes pop-ups irrelevant. If users know
      that they are clicking on a "more information" link, they can choose to
      open it in a tab or a new window, then close it or keep it available
      for further reference.

      An example of a really bad pop-up is:

      <A href="javascrip t:openWindow('b lah.html','Popu pwindow',
      'scrollbars=yes ,resizable=yes, HEIGHT=690,WIDT H=800,')">Blah page</A>

      It prevents users even having the choice - this 'link' will either open
      in a new window under the programmers control, or not at all. If a
      user attempts to open it in a tab or new window, they'll perhaps get an
      error message, or more likely nothing at all will happen.

      --
      Fred

      Comment

      • David Hayes

        #4
        Re: The ongoing new-window Resize debate

        "Mick White" <mwhite13BOGUS@ rochester.rr.co m> wrote in message
        news:HkXEd.1347 94$Uf.88891@twi ster.nyroc.rr.c om...[color=blue]
        > David Hayes wrote:[color=green]
        > > I like availWidth and availHeight, but I'd much rather work with
        > > window.availWid th and window.availHei ght. Unfortunately, they just[/color][/color]
        aren't[color=blue][color=green]
        > > universally available. When I ran a function to see which ones were[/color]
        >
        > Window size != screen size.
        > Mick[/color]

        I know that window size doesn't equal screen size. What I would like would
        be to set the design of the inner space of the browser on the basis of the
        window size. If I could, the new window (or the new page within the same
        window) would be the same dimensions as the window that the user already is
        looking at. This would satisfy the user who has determined how much of his
        screen he wants to allot to the browser and doesn't care to see the link
        take him to a page that uses a larger or smaller portion of the desktop.

        --
        David Hayes

        (remove the name of the programming language from email address to make it
        usable)


        Comment

        • Mick White

          #5
          Re: The ongoing new-window Resize debate

          David Hayes wrote:
          [color=blue]
          > "Mick White" <mwhite13BOGUS@ rochester.rr.co m> wrote in message[/color]
          [color=blue][color=green]
          >>Window size != screen size.
          >>Mick[/color]
          >
          >
          > I know that window size doesn't equal screen size. What I would like would
          > be to set the design of the inner space of the browser on the basis of the
          > window size. If I could, the new window (or the new page within the same
          > window) would be the same dimensions as the window that the user already is
          > looking at.[/color]

          This is default behaviour, no need for js to manipulate new window.
          Mick

          ....snip

          Comment

          • David Hayes

            #6
            Re: The ongoing new-window Resize debate

            "Mick White" <mwhite13BOGUS@ rochester.rr.co m> wrote in message
            news:2cvFd.2625 1$Xs6.21876@twi ster.nyroc.rr.c om...[color=blue]
            > David Hayes wrote:
            > [...][color=green]
            > > I know that window size doesn't equal screen size. What I would like[/color][/color]
            would[color=blue][color=green]
            > > be to set the design of the inner space of the browser on the basis of[/color][/color]
            the[color=blue][color=green]
            > > window size. If I could, the new window (or the new page within the[/color][/color]
            same[color=blue][color=green]
            > > window) would be the same dimensions as the window that the user already[/color][/color]
            is[color=blue][color=green]
            > > looking at.[/color]
            >
            > This is default behaviour, no need for js to manipulate new window.[/color]

            There's no need to manipulate JavaScript to establish that the new window
            will be the same size as the previous -- BUT THERE would be a benefit to
            using the browser window's actual width (as opposed to screen width) to
            position images mid-screen, set graphics to appear directly above columns
            set to fill particular dimensions, etc. Sure, tables are wonderful to
            positioning things at particular percentages and a given number of pixels,
            but sometimes this is not enough. The context in which the desire of mine
            was first mentioned, that being in the first message on this thread --
            wherein I spoke before about tables and screen locations, and quoted from
            another person who wrote on this subject in this newsgroup -- should suggest
            the scope which should be considered when one responds with a rejoinder,
            piece of advice, recommendation or suggestion that the person seeking a
            JavaScript doesn't know enough about defaults outside of JS.

            --
            David Hayes

            (remove the name of the programming language from email address to make it
            usable)



            Comment

            • Mick White

              #7
              Re: The ongoing new-window Resize debate

              David Hayes wrote:
              [color=blue]
              >
              > There's no need to manipulate JavaScript to establish that the new window
              > will be the same size as the previous -- BUT THERE would be a benefit to
              > using the browser window's actual width (as opposed to screen width) to
              > position images mid-screen, set graphics to appear directly above columns
              > set to fill particular dimensions, etc. Sure, tables are wonderful to
              > positioning things at particular percentages and a given number of pixels,
              > but sometimes this is not enough. The context in which the desire of mine
              > was first mentioned, that being in the first message on this thread --
              > wherein I spoke before about tables and screen locations, and quoted from
              > another person who wrote on this subject in this newsgroup -- should suggest
              > the scope which should be considered when one responds with a rejoinder,
              > piece of advice, recommendation or suggestion that the person seeking a
              > JavaScript doesn't know enough about defaults outside of JS.[/color]


              var windowWidth= window.innerWid th?window.inner Width:
              document.client Width?document. clientWidth:"un known"

              Note that IE determines window size after all content is loaded. And I'm
              not 100% sure of references.

              Mick

              Comment

              Working...