3

I'm using this script: Set iframe content height to auto resize dynamically, only 3 iframes I have, and this script only works with one and not with the 3, what do I do?

Here is a snippet showing the iframe in my page:

<script type='text/javascript'>

    function setIframeHeight(iframeId) {

        var ifDoc, ifRef = document.getElementById( iframeId );
        try {
            ifDoc = ifRef.contentWindow.document.documentElement;
        } catch (e) {
            try {
                ifDoc = ifRef.contentDocument.documentElement;
            } catch (ee) { } 
        }

        if (fDoc) {
            ifRef.height = 1;
            ifRef.height = ifDoc.scrollHeight;
       }

</script>

<iframe id="contentFrame" scrolling="no" frameborder="0" width="100%"
    src="http://ivomenezes.com/frames/home.php"
    onload="setIframeHeight('contentFrame')"> </iframe>
Community
  • 1
  • 1
Ivo Menezes
  • 31
  • 1
  • 2

0 Answers0