Window frame width and height property

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

    Window frame width and height property

    I am not sure this is the right place to ask this question. I have a
    web page composed with two frames (left and right). Then in my
    frmae2(right one) , I open a pop-up window by javscript:
    window.open(... ). I hope the pop-up window has the same size of the
    frame2, therefore I use the document.body.i nnerHeight and InnerWidth
    (this is on IE 6), but My question is how can I get the left-top
    position of the frame2 so that I can use the moveTo() to superimpose the
    pop-up window over the frame2. It will make the popup looks like laid
    top of frame2 at least from the openning of the main window. I can not
    find anything about the frame.height and .width. Can anyone give me a
    clue?

    C Chang
  • Richard Cornford

    #2
    Re: Window frame width and height property

    cschang wrote:[color=blue]
    > I am not sure this is the right place to ask this question.[/color]

    Questions about the scripting of web pages are the main subject of this
    group.
    [color=blue]
    > I have a web page composed with two frames (left
    > and right). Then in my frmae2(right one) , I open
    > a pop-up window by javscript: window.open(... ).[/color]

    Pop-up blocking means that maybe you don't open a new window for a
    proportion of users.
    [color=blue]
    > I hope the pop-up window has the same size of the
    > frame2,[/color]

    Hope?
    [color=blue]
    > therefore I use the document.body.i nnerHeight and InnerWidth
    > (this is on IE 6),[/color]

    innerWidth/Height are not intended to report client area dimensions. On
    IE clinetWidth/Height are more useful, though on IE 6 it may not be the
    body that they should be read from (depending on the value of
    document.compat Mode).
    [color=blue]
    > but My question is how can I get the left-top
    > position of the frame2[/color]

    Given a mouse event object, you can use the difference between clinteX/Y
    and screenX/Y to calculate the screen co-ordinates of the top left
    corner of the client area. However, there is no cross-browser method of
    positioning a new window at those co-ordinates (even with browsers that
    are capable/willing to open new windows).
    [color=blue]
    > so that I can use the moveTo() to superimpose
    > the pop-up window over the frame2.[/color]

    Scripted control of window positioning is being increasingly restricted
    due to abuse of the facility, so this is an optimistic desire.
    [color=blue]
    > It will make the popup looks like laid top of
    > frame2 at least from the openning of the main window.[/color]

    As you have extremely restricted control over window chrome this seems a
    value-less activity.
    [color=blue]
    > I can not find anything about the
    > frame.height and .width. Can anyone
    > give me a clue?[/color]

    It strikes me that wanting to alter the user's display in an area
    restricted to that of a frame in a browser, the sensible approach would
    be to restrict activity to within that frame.

    Richard.


    Comment

    • Martin Honnen

      #3
      Re: Window frame width and height property



      cschang wrote:
      [color=blue]
      > I have a
      > web page composed with two frames (left and right). Then in my
      > frmae2(right one) , I open a pop-up window by javscript:
      > window.open(... ). I hope the pop-up window has the same size of the
      > frame2, therefore I use the document.body.i nnerHeight and InnerWidth
      > (this is on IE 6), but My question is how can I get the left-top
      > position of the frame2[/color]

      With IE you can use
      window.screenLe ft
      window.screenTo p
      from inside the frame to find position relative to the screen.

      --

      Martin Honnen

      Comment

      Working...