Results 1 to 5 of 5

Thread: IFrame SSI script II

  1. #1
    Join Date
    Feb 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default IFrame SSI script II

    1) Script Title: IFrame SSI script II

    2) Script URL (on DD):http://www.dynamicdrive.com/dynamici...iframessi2.htm

    3) Describe problem: I have used this script successfully on IE 8 and below. I recently purchased a new laptop that uses IE 9. When I load my webpage, the IFRAME does not dynamically change as it has on past browsers. Is there a fix for this? Please help.

    This is the website that I created: http://socaphland.org

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Are you talking about archive.html? It does not resize in Firefox either.
    ===
    Arie Molendijk

  3. #3
    Join Date
    Feb 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Correct. It does not resize in the latest version of Firefox as well.

  4. #4
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Then replace the dynamicdrive script with this:
    Code:
    <script type="text/javascript">
    /* free code from dyn-web.com */
    
    function getDocHeight(doc) {
    doc = doc || document;
    // from http://stackoverflow.com/questions/1145850/get-height-of-entire-document-with-javascript
    var body = doc.body, html = doc.documentElement;
    var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
    return height;
    
    }
    
    function setIframeHeight(id) {
    var ifrm = document.getElementById(id);
    var doc = ifrm.contentDocument? ifrm.contentDocument: ifrm.contentWindow.document;
    ifrm.style.visibility = 'hidden';
    ifrm.style.height = "10px"; // reset to minimal height in case going from longer to shorter doc
    ifrm.style.height = getDocHeight( doc ) + 5+"px";
    ifrm.style.visibility = 'visible';
    }
    </script>
    and add the following to your iframe tag:
    Code:
    onload="setIframeHeight('myframe')"
    This works with me.
    ===
    Arie Molendijk.
    Last edited by molendijk; 02-19-2012 at 02:02 AM.

  5. The Following User Says Thank You to molendijk For This Useful Post:

    dw66stk (02-19-2012)

  6. #5
    Join Date
    Feb 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    That seemed to correct my problem!! Thank you so much for taking time to look into my problem!!

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
  •