popups relative to resolution?

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

    #1

    popups relative to resolution?

    Hi,
    Does anyone know where I can get a script for a pop-up where I can
    control fixed positioning of a popup based on browser resolution?

    two res's: 800 x 600 and 1024 x 768

    Thanks in advance

    Lee


  • Lasse Reichstein Nielsen

    #2
    Re: popups relative to resolution?

    "Lee Mundie" <lee.j.mundie@n tlworld.com> writes:
    [color=blue]
    > Does anyone know where I can get a script for a pop-up where I can
    > control fixed positioning of a popup based on browser resolution?
    >
    > two res's: 800 x 600 and 1024 x 768[/color]

    Those are screen resolutions, not browser resolutions. My browser
    typically takes up ~900x1000 on a 1600x1200 screen. Since it is an MDI
    client, new popups cannot be larger than the visible area of the
    browser viewport (~900x900) and cannot be placed outside those bounds
    either.

    So, don't use screen resolution, it's not relevant to the task. And be very
    careful when positioning new windows, since there are several cases where
    your attempts fail badly.

    With that being said, you position new windows created with
    window.open using the third argument. Example:

    var win = window.open("so meURL.html","wi ndowName",
    "width=400,heig ht=300,top=100, left=120,resiza ble=yes");

    Making the position depend on screen resolution (bad choice!) would be:

    ---
    var left=120,top=10 0;
    if (screen.width == 800) {
    left = 300;
    top = 200;
    } else if (screen.width == 1024) {
    left = 500;
    top = 300;
    }
    var win = window.open("so meURL.html","wi ndowName",
    "width=400,heig ht=300," +
    "top=" + top + ",left=" + left + ",resizable=yes ");
    ---

    You can read more here:
    <URL:http://www.infimum.dk/HTML/JSwindows.html# ref_3_2>

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Fabian

      #3
      Re: popups relative to resolution?

      Lee Mundie hu kiteb:
      [color=blue]
      > Hi,
      > Does anyone know where I can get a script for a pop-up where I can
      > control fixed positioning of a popup based on browser resolution?
      >
      > two res's: 800 x 600 and 1024 x 768[/color]

      What about where the browser is not maximised?


      --
      --
      Fabian
      Visit my website often and for long periods!


      Comment

      Working...