javascript in containers (iframe)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Catherine Lynn Smith

    javascript in containers (iframe)

    I want to know the recommended way to handle scripting of/with
    containers such as an iframe. I have a page with border-navigation
    bars on the top/bottom/left/right and I want to use an iframe to load
    content in the middle.

    I would like, if possible, to have the parent window resize itself to
    suit whatever is loaded into the iframe container, deriving the size
    needed from calculated values. Thus the calculation would have to
    over-ride default and/or previous settings for the size of the initial
    iframe after all of the associated container content has been fully
    loaded and rendered.

    Any information and assistance is appreciated.

    KL

    P.S. Also, as a side note... I have noticed some less than favorable
    results in netscape for deriving calculated size as well as iffy
    ability to force and/or calculate the height of such content to fully
    fill the frame. Any tips on how to force said content to fully fill
    and/or expand the container vertically would also be appreciated.
  • HikksNotAtHome

    #2
    Re: javascript in containers (iframe)

    In article <5fb632c2.03100 60925.56a93912@ posting.google. com>,
    klynntg@hotmail .com (Catherine Lynn Smith) writes:
    [color=blue]
    >I want to know the recommended way to handle scripting of/with
    >containers such as an iframe. I have a page with border-navigation
    >bars on the top/bottom/left/right and I want to use an iframe to load
    >content in the middle.
    >
    >I would like, if possible, to have the parent window resize itself to
    >suit whatever is loaded into the iframe container, deriving the size
    >needed from calculated values. Thus the calculation would have to
    >over-ride default and/or previous settings for the size of the initial
    >iframe after all of the associated container content has been fully
    >loaded and rendered.
    >
    >Any information and assistance is appreciated.[/color]

    Set the IFrames width and height, same as you would a normal frame (if there is
    such a thing). document.frames['IFrameName'].widht/height
    [color=blue]
    >KL
    >
    >P.S. Also, as a side note... I have noticed some less than favorable
    >results in netscape for deriving calculated size as well as iffy
    >ability to force and/or calculate the height of such content to fully
    >fill the frame. Any tips on how to force said content to fully fill
    >and/or expand the container vertically would also be appreciated.[/color]

    An answer to the common newbie questions on whether a Web author can 'force' a browser to do things.

    --
    Randy

    Comment

    • Catherine Lynn Smith

      #3
      Re: javascript in containers (iframe)

      hikksnotathome@ aol.com (HikksNotAtHome ) wrote in message news:<200310062 33928.08626.000 01092@mb-m27.aol.com>...[color=blue]
      > In article <5fb632c2.03100 60925.56a93912@ posting.google. com>,
      > klynntg@hotmail .com (Catherine Lynn Smith) writes:
      >[color=green]
      > >I want to know the recommended way to handle scripting of/with
      > >containers such as an iframe.
      > >
      > >I would like, if possible, to have the parent window resize itself to
      > >suit whatever is loaded into the iframe container, deriving the size
      > >needed from calculated values. Thus the calculation would have to
      > >over-ride default and/or previous settings for the size of the initial
      > >iframe after all of the associated container content has been fully
      > >loaded and rendered.
      > >
      > >Any information and assistance is appreciated.[/color]
      >
      > Set the IFrames width and height, same as you would a normal frame (if there is
      > such a thing). document.frames['IFrameName'].widht/height[/color]

      I do intilize the iframe with a standard size then have it resize to
      fit the size of the browser. Currently, the border design is built
      around an 800x600 window size so I set a 'minimum' value for the x and
      y that if the browser is made smaller than this amount, the border
      content 'stops' getting smaller and the scroll bars thus turn on to
      provide panning.

      Due to the size of the borders, however, the center content area ends
      up being only about 500x400 in size and some of the pages I want to
      load into that iframe are going to need more size than this. I would
      like, if it is possible, to 'read' the calculated minimum 'width' and
      'size' from the iframe content after it is reloaded then reset the
      minimum values for the total parent window size based on this center
      content minimum width and height.

      I currently have the scroll bars turned off on the iframe, and would
      thus like to reset the minimum and redraw the borders so the parent
      window scroll bars will facilitate panning of the entire page (center
      content in the iframe + the borders on the parent window) but I am not
      sure how to:

      1) have the browser derive the 'needed' minimum size for the iframe
      prior to doing any resizing of the parent window. (due to the fact
      the iframe size is previously 'fixed' in size, any values I have tried
      to extract from the DOM relate to it's present size)
      2) I am still a tad confused on the scope between the iframe and the
      parent window as far as navigating the DOM nodes is concerned or the
      variables and assignments in the javascripting.

      I am guessing that it may be necessary to hard code the sizing
      requirements somewhere in all the center content pages which I would
      like to avoid if possible should there be any way to derive the
      necessary sizing values from calculated properties. But even if I
      hard code or find a way to extract the necessary parameters, I am
      still unclear on how to pass that information to the parent window or
      extract the values from the iframe.

      KL

      Comment

      • Catherine Lynn Smith

        #4
        Re: javascript in containers (iframe)

        As an addendum, while waiting for my message to post and to get any
        consequent replies, I have figured out how to read the properties
        either from the internal content or from the parent frame. But that
        still leaves me with the javascript scope questions.

        One of my goals is to try to leave the pages loaded into the center
        area as 'dumb' as possible (i.e. the less parent specific nonsense in
        them the better as I will probably create a wrapper or at least a test
        to send people too lazy to upgrade their browsers off to these pages
        directly rather than load them into my border page)

        Now that I am able to read and set the values I need, I need to figure
        out how to trigger the actually event to resize them. Of course, the
        simplest would be an 'onload' event in the HTML of the child page
        being loaded into the iframe, but as I just mentioned, I want to avoid
        any parent specific coding if possible in those content pages.

        Is there a way to trigger a function call 'from the parent page' when
        the iframe (child) is done loading and rendering?

        KL

        Comment

        Working...