Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Thanked 0 Times in 0 Posts

    Can't get dynamic iFrame re-size to work in Safari. Help!

    Hey guys!
    Well, I have a dynamic iFrame which changes height every time new content is loaded into it. However, the iFrame re-sizes properly in all browsers when the content is longer then before load.

    BUT, here is my problem:
    When for example loading something that is shorter then the load before it doesn't down-size in Safari!

    In all the other browsers the down-size is working beautifully, but now in Safari.

    Please, if someone has a solution for this I would be so great full!

    Is there any way to kind of reset the iFrame to height="0" in the beginning of the script or is it just cause Safari doesn't trigger the "onload" function?

    The code I am using is:

    <script language="JavaScript">
    function autoResize(id){
    var newheight;
    var newwidth;

    newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
    newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;

    document.getElementById(id).height= (newheight) + "px";
    document.getElementById(id).width= (newwidth) + "px";

    Best Regards,

  • #2
    New Coder
    Join Date
    Aug 2008
    Colfax, California USA
    Thanked 5 Times in 5 Posts
    could we see the code in action please?

    Is it Safari 1, 2, or 3? You could try downloading webkit (Safari's beta version and see if it was a glitch and now is fixed…


    Posting Permissions

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