maximise window problem with taskbar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Poulos

    #1

    maximise window problem with taskbar

    If I use this code to maximise a browser window:

    window.moveTo(0 ,0);
    window.resizeTo (screen.width,s creen.height);

    it works but on Windows the user can have a taskbar visible and the
    browser window goes behind it.

    Is there a way to know where the taskbar is?

    Andrew Poulos
  • Randy Webb

    #2
    Re: maximise window problem with taskbar

    Andrew Poulos wrote:
    [color=blue]
    > If I use this code to maximise a browser window:[/color]

    No, you use it to *attempt* to "maximise" a browser window. Subtle
    difference but a huge difference.
    [color=blue]
    > window.moveTo(0 ,0);
    > window.resizeTo (screen.width,s creen.height);[/color]

    What makes you think I want my browser window to be 2048 pixels wide?
    [color=blue]
    > it works but on Windows the user can have a taskbar visible and the
    > browser window goes behind it.[/color]

    I disagree with the "it works".
    [color=blue]
    > Is there a way to know where the taskbar is?[/color]

    No. Stop trying to tell the user what size to have there windows, and it
    becomes a moot point.
    <URL: http://allmyfaqs.com/faq.pl?AnySizeDesign >




    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • Jan-Christoph Ihrens

      #3
      Re: maximise window problem with taskbar

      Randy Webb schrieb:
      [color=blue]
      > Andrew Poulos wrote:
      >[color=green]
      > > If I use this code to maximise a browser window:[/color]
      >
      > No, you use it to *attempt* to "maximise" a browser window. Subtle
      > difference but a huge difference.
      >[color=green]
      > > window.moveTo(0 ,0);
      > > window.resizeTo (screen.width,s creen.height);[/color]
      >
      > What makes you think I want my browser window to be 2048 pixels wide?
      >[color=green]
      > > it works but on Windows the user can have a taskbar visible and the
      > > browser window goes behind it.[/color]
      >
      > I disagree with the "it works".
      >[color=green]
      > > Is there a way to know where the taskbar is?[/color]
      >
      > No. Stop trying to tell the user what size to have there windows,
      > and it becomes a moot point.
      > <URL: http://allmyfaqs.com/faq.pl?AnySizeDesign >[/color]


      Hello Andrew,

      I absolutely agree with Randy. Nevertheless, if you absolutely want to
      maximize the window, take a closer look at the screen object:

      window.moveTo(s creen.availLeft , screen.avail.To p);
      window.resizeTo (screen.availWi dth, screen.availHei ght);

      should be what you're looking for.

      Greetings,
      Jan

      Comment

      • Grant Wagner

        #4
        Re: maximise window problem with taskbar

        Jan-Christoph Ihrens wrote:
        [color=blue]
        > Randy Webb schrieb:
        >[color=green]
        > > Andrew Poulos wrote:
        > >[color=darkred]
        > > > If I use this code to maximise a browser window:[/color]
        > >
        > > No, you use it to *attempt* to "maximise" a browser window. Subtle
        > > difference but a huge difference.
        > >[color=darkred]
        > > > window.moveTo(0 ,0);
        > > > window.resizeTo (screen.width,s creen.height);[/color]
        > >
        > > What makes you think I want my browser window to be 2048 pixels wide?
        > >[color=darkred]
        > > > it works but on Windows the user can have a taskbar visible and the
        > > > browser window goes behind it.[/color]
        > >
        > > I disagree with the "it works".
        > >[color=darkred]
        > > > Is there a way to know where the taskbar is?[/color]
        > >
        > > No. Stop trying to tell the user what size to have there windows,
        > > and it becomes a moot point.
        > > <URL: http://allmyfaqs.com/faq.pl?AnySizeDesign >[/color]
        >
        > Hello Andrew,
        >
        > I absolutely agree with Randy. Nevertheless, if you absolutely want to
        > maximize the window, take a closer look at the screen object:
        >
        > window.moveTo(s creen.availLeft , screen.avail.To p);[/color]

        Of Internet Explorer 6SP1, Opera 6.05, Opera 7.54, Firefox 0.9.3, Mozilla
        1.7.2 and Netscape 4.78. Only Firefox 0.9.3, Mozilla 1.7.2 and Netscape
        4.78 support screen.availLef t/availTop. Your code works as written because
        the "undefined" value returned by screen.availLef t/availTop is type
        converted to 0 by the moveTo() method (which expects a Number). You may
        want to make this type conversion explicit with:

        window.moveTo(( screen.availLef t || 0), (screen.availTo p || 0));

        doing this clearly shows that screen.availLef t can be "undefined" or null
        on some user agents, and as a result, the coordinates of 0,0 are used in
        those cases (which could potentially cover up a task or toolbar residing at
        the top or left of the screen).
        [color=blue]
        > window.resizeTo (screen.availWi dth, screen.availHei ght);[/color]

        window.resizeTo () in Netscape 4.xx resizes the browser's _viewport_ to the
        specified values, not the outer browser window dimensions. As a result, you
        end up with a window that is both too wide and too tall. The correct way to
        resize the window in Netscape (if you insist on doing something or
        proactively user hostile) is to adjust window.outerWid th/outerHeight.

        window.resizeTo () in Opera 7.54 makes the MDI window inside Opera so wide
        and tall that the scrollbar on the right is completely inaccessible. Oddly
        enough, Opera 6.05 seems to be a bit more friendly under these
        circumstances. It only makes the MDI window the maximum dimensions which
        the outer MDI frame can accomodate.
        [color=blue]
        > should be what you're looking for.[/color]

        Thankfully I can configure Firefox and other Gecko-based browsers to ignore
        this nonsense entirely. In those cases, this page author will get nowhere
        near the behaviour they are expecting.

        This should be _clearly_ spelled out. More and more users are taking steps
        to prevent Web site authors from messing with their browsers in these ways.
        If your public Web site depends on a "fullscreen " window (which can have a
        variety of meanings given multiple monitor configurations some users have),
        you are fooling yourself if you think you can open everyone's browser
        window to fill their screen.

        --
        Grant Wagner <gwagner@agrico reunited.com>
        comp.lang.javas cript FAQ - http://jibbering.com/faq

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: maximise window problem with taskbar

          Jan-Christoph Ihrens wrote:
          [color=blue]
          > Hello Andrew,[/color]

          This is a public newsgroup, not private e-mail.
          [color=blue]
          > [...] if you absolutely want to maximize the window,
          > take a closer look at the screen object:
          >
          > window.moveTo(s creen.availLeft , screen.avail.To p);
          > window.resizeTo (screen.availWi dth, screen.availHei ght);
          >
          > should be what you're looking for.[/color]

          It should not, see [de] <http://praast.de/ffq/abfrage/#monitor>.


          PointedEars
          --
          This sig intentionally left blank.

          Comment

          Working...