SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2003
    Location
    here
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iframes and Netscape 6

    I have an issue with netscape 6.2 and iframes (my project must support IE and Netscape 6.2).

    I am dynamically writing to an iframe .
    I can't have scrollbars so need to resize the iframe to the size of the text that is in it.

    I do this in IE with:

    myHeight = document.frames('myIframe').document.body.scrollHeight;
    document.all.myIframe.style.height = myHeight;

    fine no problem.

    An NS 7 this worked:

    myHeight = document.getElementById('myIframe').contentDocument.body.scrollHeight;
    document.getElementById('myIframe').style.height = h

    but in netscape 6.2 this dosen't work.

    I can set the height of the iframe, but cannot get the size of the text area inside it to set the height correctly

    So, I need a way to get the total area taken up by the text inside.

    Any help, insight, code snippets or links to information will be so very much appreciated.

    Cheers.

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Might want to try this:

    myHeight = frames.myIframe.document.height;
    document.getElementById('myIframe').style.height = h

    I'd amend this:

    myHeight = frames.myIframe.document.getElementsByTagName('body')[0].scrollHeight;
    document.getElementById('myIframe').style.height = myHeight;

  3. #3
    SitePoint Member
    Join Date
    May 2003
    Location
    here
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey thanks adios!!!

    that gets it worken.

    Cheers!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •