Resize browser window... why such a pain?

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

    Resize browser window... why such a pain?

    I have an Intranet application that is targeted to IE browsers only.
    It is also designed explicitly to fit an 800x600 window. That said, I
    wish to ensure that the browser window sizes appropriately when they
    log in. I'm using this right now:

    <HEAD>
    <title>My Login Page</title>
    <meta content="Micros oft Visual Studio .NET 7.1" name="GENERATOR ">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANG UAGE">
    <meta content="JavaSc ript" name="vs_defaul tClientScript">
    <meta content="http://schemas.microso ft.com/intellisense/ie5"
    name="vs_target Schema">
    <script type="text/javascript">
    {
    window.resizeTo (828,732)
    }
    </script>
    </HEAD>

  • jef

    #2
    Re: Resize browser window... why such a pain?

    Oops... the rest of the post got chopped off.

    My existing solution is funky because it only works if the user has the
    default toolbar/menubar configuration of IE. I need a way to force the
    window to resize based on the content being 800x600 regardless of the
    menubar/toolbar height.

    Comment

    • Randy Webb

      #3
      Re: Resize browser window... why such a pain?

      jef wrote:[color=blue]
      > I have an Intranet application that is targeted to IE browsers only.
      > It is also designed explicitly to fit an 800x600 window. That said, I
      > wish to ensure that the browser window sizes appropriately when they
      > log in. I'm using this right now:
      >
      ><HEAD>
      ><title>My Login Page</title>
      ><meta content="Micros oft Visual Studio .NET 7.1" name="GENERATOR ">
      ><meta content="Visual Basic .NET 7.1" name="CODE_LANG UAGE">
      ><meta content="JavaSc ript" name="vs_defaul tClientScript">
      ><meta content="http://schemas.microso ft.com/intellisense/ie5" name="vs_target Schema">
      ><script type="text/javascript">
      >{window.resize To(828,732)}
      ></script>
      ></HEAD>[/color]

      Since you are using a lot of IE specific items already, I assume your
      intranet is IE only. If it is, then you can open a new window, the size
      you want, with the parameters you want, and then close the original
      window with window.close(). To get IE to allow you to close a window
      that you didn't open with script, set the original window's .opener
      property to anything you like and then it will be close-able by script.

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

      Comment

      • RobG

        #4
        Re: Resize browser window... why such a pain?

        jef wrote:[color=blue]
        > Oops... the rest of the post got chopped off.
        >
        > My existing solution is funky because it only works if the user has the
        > default toolbar/menubar configuration of IE. I need a way to force the
        > window to resize based on the content being 800x600 regardless of the
        > menubar/toolbar height.
        >[/color]

        Have a poke around here and see if something suits:

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

        clientWidth/Height may figure in the solution.

        --
        Rob

        Comment

        • Dietmar Meier

          #5
          Re: Resize browser window... why such a pain?

          jef wrote:
          [color=blue]
          > I have an Intranet application that is targeted to IE browsers only.
          > It is also designed explicitly to fit an 800x600 window.[/color]

          You should rather change that design, but this should help you for
          the moment:

          function resizeCanvas(nW idth, nHeight) {
          var nDX, nDY, sMode, oCanvasContaine r;
          if ((sMode = document.compat Mode) && sMode == "CSS1Compat ") {
          oCanvasContaine r = document.docume ntElement;
          }
          else {
          oCanvasContaine r = document.body;
          }
          if (oCanvasContain er) {
          nDX = nWidth - oCanvasContaine r.clientWidth;
          nDY = nHeight - oCanvasContaine r.clientHeight;
          if (!isNaN(nDX) && !isNaN(nDY) && window.resizeBy ) {
          window.resizeBy (nDX, nDY);
          }
          }
          }
          onload = function() {
          resizeCanvas(80 0, 600);
          }

          ciao, dhgm

          Comment

          Working...