Automatic Pop-up Window Sizer

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

    Automatic Pop-up Window Sizer

    I have a JavaScript which opens a document in a pop-up window. The complete
    document content is contained within a table of fixed width. Currently, I
    pass with window height & width as parms. What I would really like is a way
    to have the JavaScript automatically resize the window to fit the table!
    With some digging I suspect I can get the table width but how do I get the
    table length which is dependant on the amount of content?

    Any help or suggestions would be appreciated.... thanks....brian



  • Marco Snoek

    #2
    Re: Automatic Pop-up Window Sizer

    Can't you use <IFRAME> ?

    in that case you put the table in te iframe, and instead of showing the
    popup as e new window, load it into the IFRAME.

    If you still want to use the popup try to search for offsetheight:

    I used once:
    hgt =
    (document.all)? document.getEle mentById("datat d").clientHeigh t:document.getE l
    ementById("data td").offsetHeig ht;
    to get the height of a TD.. guess you can make it work for a table as well

    good luck.

    Marco


    "Brian" <noemail@rogers .com> schreef in bericht
    news:x4Wbb.9934 2$DZ.90934@news 04.bloor.is.net .cable.rogers.c om...[color=blue]
    > I have a JavaScript which opens a document in a pop-up window. The[/color]
    complete[color=blue]
    > document content is contained within a table of fixed width. Currently, I
    > pass with window height & width as parms. What I would really like is a[/color]
    way[color=blue]
    > to have the JavaScript automatically resize the window to fit the table!
    > With some digging I suspect I can get the table width but how do I get the
    > table length which is dependant on the amount of content?
    >
    > Any help or suggestions would be appreciated.... thanks....brian
    >
    >
    >[/color]


    Comment

    • Ivo

      #3
      Re: Automatic Pop-up Window Sizer

      "Brian" <noemail@rogers .com> wrote in message
      news:x4Wbb.9934 2$DZ.90934@news 04.bloor.is.net .cable.rogers.c om...[color=blue]
      > I have a JavaScript which opens a document in a pop-up window. The[/color]
      complete[color=blue]
      > document content is contained within a table of fixed width. Currently, I
      > pass with window height & width as parms. What I would really like is a[/color]
      way[color=blue]
      > to have the JavaScript automatically resize the window to fit the table!
      > With some digging I suspect I can get the table width but how do I get the
      > table length which is dependant on the amount of content?[/color]

      Not sure about the rest, but in my IE I get good values for a table with id
      TableID using
      document.all.Ta bleID.clientWid th and document.all.le den.clientHeigh t
      and document.all.Ta bleID.scrollWid th and document.all.le den.scrollHeigh t
      HTH
      Ivo


      Comment

      Working...