Open Screen Full Window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Larry R Harrison Jr

    Open Screen Full Window

    I have pull-down menus in javascript and I have the code for opening a link
    in a new window. But I want it to open a full-sized window. I can't figure
    out the syntax. What I have so far:

    Menu5_5_1=new Array("'Lonely Church","javasc ript:window.ope n
    ('http://www.photo.net/photodb/photo?photo_id= 2640310')","",0 ,20,300);

    That works fine, except I can't figure out how to modify it to make it open
    full-screen.

    Tips?

    LRH


  • Harag

    #2
    Re: Open Screen Full Window

    On Fri, 27 Aug 2004 12:46:42 -0700, "Larry R Harrison Jr"
    <noone@noone.co m> wrote:
    [color=blue]
    >I have pull-down menus in javascript and I have the code for opening a link
    >in a new window. But I want it to open a full-sized window. I can't figure
    >out the syntax. What I have so far:
    >
    >Menu5_5_1=ne w Array("'Lonely Church","javasc ript:window.ope n
    >('http://www.photo.net/photodb/photo?photo_id= 2640310')","",0 ,20,300);
    >[/color]

    Loop up more info on the window.open() method, before the end bracket
    there is more options you can put in it.

    window.open('fi le', 'winname', 'features');

    eg
    window.open('ph oto.asp', 'PictureWindow' , 'width=300, height=300')

    if you want to do full screen in IE then put "fullscreen " in the
    features part.

    below is the open window script I use.

    HTH

    Al.


    function newWindow(sFile nameToView, sWindowName, iWidth, iHeight,
    sCanScroll, bCanResize, iLeft, iTop, sExtraSettings, bReplaceHistory )
    {
    var oNewWin = null;
    if (!sExtraSetting s) {sExtraSettings ='';}
    // iWidth/iHeight=-1 for netscape to go "near as damit" full
    screen
    // NS user needs to press F11 to go true full screen.
    if (iWidth == -1 || iHeight == -1) {
    sExtraSettings =
    sExtraSettings. replace(/fullscreen/gi, '');
    if (sExtraSettings ) {sExtraSettings += ',';}
    sExtraSettings += 'fullscreen, outerWidth=' +
    screen.width + ', outerHeight=' + screen.height;
    iLeft = 0;
    iTop = 0;
    }
    var iLeftPosition = iLeft;
    var iTopPosition = iTop;
    // iLeft/iTop=-1 centers the newwindow on the screen
    if (iLeft == -1 || iTop == -1) {
    iLeftPosition = (screen.availWi dth) ?
    (screen.availWi dth - iWidth) / 2 : 0;
    iTopPosition = (screen.availHe ight) ?
    (screen.availHe ight - iHeight) / 2 : 0;
    }

    var sWindowSettings = 'height=' + iHeight + ',width=' + iWidth
    + ',top=' + iTopPosition + ',left=' + iLeftPosition + ',scrollbars=' +
    sCanScroll + ',resizable=' + bCanResize + ',' + sExtraSettings;
    oNewWin = window.open(sFi lenameToView, sWindowName,
    sWindowSettings , bReplaceHistory );
    oNewWin.focus() ;
    return oNewWin;
    }
    [color=blue]
    >That works fine, except I can't figure out how to modify it to make it open
    >full-screen.
    >
    >Tips?
    >
    >LRH
    >[/color]

    Comment

    • Grant Wagner

      #3
      Re: Open Screen Full Window

      Harag wrote:
      [color=blue]
      > On Fri, 27 Aug 2004 12:46:42 -0700, "Larry R Harrison Jr"
      > <noone@noone.co m> wrote:
      >[color=green]
      > >I have pull-down menus in javascript and I have the code for opening a link
      > >in a new window. But I want it to open a full-sized window. I can't figure
      > >out the syntax. What I have so far:
      > >
      > >Menu5_5_1=ne w Array("'Lonely Church","javasc ript:window.ope n
      > >('http://www.photo.net/photodb/photo?photo_id= 2640310')","",0 ,20,300);
      > >[/color]
      >
      > Loop up more info on the window.open() method, before the end bracket
      > there is more options you can put in it.
      >
      > window.open('fi le', 'winname', 'features');
      >
      > eg
      > window.open('ph oto.asp', 'PictureWindow' , 'width=300, height=300')[/color]

      The 3rd parameter should not contain any spaces. Some user agents do not honor
      your "features" if you include any white space.
      [color=blue]
      > if you want to do full screen in IE then put "fullscreen " in the
      > features part.[/color]

      Documentation for window.open():

      IE: <url:
      http://msdn.microsoft.com/workshop/a...ods/open_0.asp />
      Netscape 4 (although most of this stuff is fairly cross-browser): <url:

      />
      Gecko-based browsers (Mozilla, Firefox, Camino, Netscape 7): <url:
      http://www.mozilla.org/docs/dom/domr...6.html#1019331 />

      Note that the Gecko DOM reference appears incomplete. I believe the features
      list for window.open() on Gecko-based browsers supports both screenX/Y and
      top/left (I'm probably wrong and I'm too lazy to test it).

      Also, Gecko-based browsers support "fullscreen =1", but it is not the same as the
      effect you get when you do it in IE.

      As a general rule-of-thumb when it comes to window.open() there is no general
      rule-of-thumb. You'll want to check the documentation for each user agent you
      want to support, then test the resulting code to ensure it works as documented.

      And after all that, there's no guarantee your attempt to open a new window in my
      user agent will be honored anyway. window.open() in my user agent either a) does
      nothing or b) if I really need the window to perform some task, it opens in a
      new tab which will not be resizable.

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

      Comment

      Working...