screenX and screenY not working properly

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

    screenX and screenY not working properly

    I'm trying to use a popup window script that opens the new window to a
    specific X,Y coordinate... I'm pretty sure that the window.screenX and
    window.screenY properties are the answer, but I'm having very little success
    in making this all work in both IE and NS.

    Here's my code as it stands today:

    function windowOpen3(URL , windowW, windowH) {
    strWindow =
    'toolbar=no,sta tus=no,scrollba rs=no,location= no,menubar=no,d irectories=no,r e
    sizable=0,size= yes,width=' + windowW + ',height=' + windowH +
    'screenX=100,sc reenY=100'
    window.open(URL ,'hwWindow',str Window)
    }

    IE is ignoring the X,Y coordinates completely and opening the new window so
    far over to the right that half of it is off-screen and NS is picking up the
    screenY setting but ignoring screenX.

    Am I missing something here? Please help, and TIA.

    Stanman


  • Lasse Reichstein Nielsen

    #2
    Re: screenX and screenY not working properly

    "Matt Stanley" <mstanley@hwcs. com> writes:
    [color=blue]
    > 'toolbar=no,sta tus=no,scrollba rs=no,location= no,menubar=no,d irectories=no,r e
    > sizable=0,size= yes,width=' + windowW + ',height=' + windowH +
    > 'screenX=100,sc reenY=100'[/color]
    ....[color=blue]
    > IE is ignoring the X,Y coordinates completely[/color]

    Yep. They never claimed to understand it.
    <URL:http://msdn.microsoft. com/workshop/author/dhtml/reference/methods/open_0.asp>
    [color=blue]
    > NS is picking up the screenY setting but ignoring screenX.[/color]

    Missing "," before "screenX".
    [color=blue]
    > Am I missing something here? Please help, and TIA.[/color]

    I recommend using "left" and "top" instead of "screenX" and "screenY".
    These properties seem to work in all browsers since Netscape 4 (do tell
    me if you find exceptions :)
    <URL:http://www.infimum.dk/HTML/JSwindows.html# ref_3_2>

    While it is not documented by Netscape, "left" and "top" it seems to
    be supported from (at least) Netscape 4.08.
    (<URL:http://devedge.netscap e.com/library/manuals/2000/javascript/1.3/reference/window.html#120 2731>)
    I doesn't work in Netscape 3, but that's not really a problem any more.

    Actually, I recommend aginst trying to position windows at all. In MDI
    browsers or dual-monitor displays, it can be quite disruptive, and in other
    browsers, it's usually not needed.
    <URL:http://www.infimum.dk/HTML/JSwindows.html# ref_3_3>

    /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

    • Lee

      #3
      Re: screenX and screenY not working properly

      Matt Stanley said:[color=blue]
      >
      >I'm trying to use a popup window script that opens the new window to a
      >specific X,Y coordinate... I'm pretty sure that the window.screenX and
      >window.scree nY properties are the answer, but I'm having very little success
      >in making this all work in both IE and NS.
      >
      >Here's my code as it stands today:
      >
      >function windowOpen3(URL , windowW, windowH) {
      > strWindow =
      >'toolbar=no,st atus=no,scrollb ars=no,location =no,menubar=no, directories=no, re
      >sizable=0,size =yes,width=' + windowW + ',height=' + windowH +
      >'screenX=100,s creenY=100'
      > window.open(URL ,'hwWindow',str Window)
      >}
      >
      >IE is ignoring the X,Y coordinates completely and opening the new window so
      >far over to the right that half of it is off-screen and NS is picking up the
      >screenY setting but ignoring screenX.
      >
      >Am I missing something here? Please help, and TIA.[/color]

      You're missing a comma before "screenX".
      You've invented an attribute named "size".
      IE ignores screenX and screenY, expecting left and top, instead.
      You don't need to list attributes that are set to "no", since that
      is the default if you specify values for any other attributes:

      function windowOpen3(URL , windowW, windowH) {
      strWindow = 'width=' + windowW + ',height=' + windowH
      + ',screenX=100,s creenY=100,top= 100,left=100';
      window.open(URL ,'hwWindow',str Window);
      }

      Comment

      • Matt Stanley

        #4
        Re: screenX and screenY not working properly

        Thanks so much for your help! That TOTALLY worked. It's always nice when
        developers help each other; you guys both just made my day!

        "Lasse Reichstein Nielsen" <lrn@hotpop.com > wrote in message
        news:ad50by03.f sf@hotpop.com.. .[color=blue]
        > "Matt Stanley" <mstanley@hwcs. com> writes:
        >[color=green]
        > >[/color][/color]
        'toolbar=no,sta tus=no,scrollba rs=no,location= no,menubar=no,d irectories=no,r e[color=blue][color=green]
        > > sizable=0,size= yes,width=' + windowW + ',height=' + windowH +
        > > 'screenX=100,sc reenY=100'[/color]
        > ...[color=green]
        > > IE is ignoring the X,Y coordinates completely[/color]
        >
        > Yep. They never claimed to understand it.
        >[/color]
        <URL:http://msdn.microsoft.com/workshop/a.../methods/open_
        0.asp>[color=blue]
        >[color=green]
        > > NS is picking up the screenY setting but ignoring screenX.[/color]
        >
        > Missing "," before "screenX".
        >[color=green]
        > > Am I missing something here? Please help, and TIA.[/color]
        >
        > I recommend using "left" and "top" instead of "screenX" and "screenY".
        > These properties seem to work in all browsers since Netscape 4 (do tell
        > me if you find exceptions :)
        > <URL:http://www.infimum.dk/HTML/JSwindows.html# ref_3_2>
        >
        > While it is not documented by Netscape, "left" and "top" it seems to
        > be supported from (at least) Netscape 4.08.
        >[/color]
        (<URL:http://devedge.netscape.com/library/...ipt/1.3/refere
        nce/window.html#120 2731>)[color=blue]
        > I doesn't work in Netscape 3, but that's not really a problem any more.
        >
        > Actually, I recommend aginst trying to position windows at all. In MDI
        > browsers or dual-monitor displays, it can be quite disruptive, and in[/color]
        other[color=blue]
        > browsers, it's usually not needed.
        > <URL:http://www.infimum.dk/HTML/JSwindows.html# ref_3_3>
        >
        > /L
        > --
        > Lasse Reichstein Nielsen - lrn@hotpop.com
        > DHTML Death Colors:[/color]
        <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>[color=blue]
        > 'Faith without judgement merely degrades the spirit divine.'[/color]


        Comment

        • Matt Stanley

          #5
          Re: screenX and screenY not working properly

          Thanks so much for your help! That TOTALLY worked. It's always nice when
          developers help each other; you guys both just made my day!

          "Lee" <REM0VElbspamtr ap@cox.net> wrote in message
          news:btf8as066k @drn.newsguy.co m...[color=blue]
          > Matt Stanley said:[color=green]
          > >
          > >I'm trying to use a popup window script that opens the new window to a
          > >specific X,Y coordinate... I'm pretty sure that the window.screenX and
          > >window.scree nY properties are the answer, but I'm having very little[/color][/color]
          success[color=blue][color=green]
          > >in making this all work in both IE and NS.
          > >
          > >Here's my code as it stands today:
          > >
          > >function windowOpen3(URL , windowW, windowH) {
          > > strWindow =[/color]
          >
          >'toolbar=no,st atus=no,scrollb ars=no,location =no,menubar=no, directories=no, r[/color]
          e[color=blue][color=green]
          > >sizable=0,size =yes,width=' + windowW + ',height=' + windowH +
          > >'screenX=100,s creenY=100'
          > > window.open(URL ,'hwWindow',str Window)
          > >}
          > >
          > >IE is ignoring the X,Y coordinates completely and opening the new window[/color][/color]
          so[color=blue][color=green]
          > >far over to the right that half of it is off-screen and NS is picking up[/color][/color]
          the[color=blue][color=green]
          > >screenY setting but ignoring screenX.
          > >
          > >Am I missing something here? Please help, and TIA.[/color]
          >
          > You're missing a comma before "screenX".
          > You've invented an attribute named "size".
          > IE ignores screenX and screenY, expecting left and top, instead.
          > You don't need to list attributes that are set to "no", since that
          > is the default if you specify values for any other attributes:
          >
          > function windowOpen3(URL , windowW, windowH) {
          > strWindow = 'width=' + windowW + ',height=' + windowH
          > + ',screenX=100,s creenY=100,top= 100,left=100';
          > window.open(URL ,'hwWindow',str Window);
          > }
          >[/color]


          Comment

          Working...