iframe resizing.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CJ4R
    New Member
    • Aug 2008
    • 1

    iframe resizing.

    Have an issue with an iframe in FF blocking links in a z-index layer behind the layer containing the iframe. It works in IE. I can't change the layer index of the iframe because it's content needs to be on top all the time. Whenever the user mouseovers that iframe content it should expand to full size.

    I haven't figured out how to change the height of the ifrmae from Doc2. It should be something like...
    parent.doc1div. doc1frame.style .height="300";

    I think. not sure.

    Document 1.
    [HTML]<html>
    <head>
    <title>doc1</title>
    </head>
    <body>
    <div id="doc1div" height='500'></div>
    <script type="text/javascript">
    document.getEle mentById('doc1d iv').innerHTML = "<iframe id='doc1frame' src='doc2.html' frameborder='no ' width='1000' height='40' scrolling='no' allowtransparen cy='true' background-color='transpar ent'></iframe>";
    </script>
    <!-- other doc1 content -->
    </body>

    Document 2
    <html>
    <head>
    <script type="text/javascript">
    <!--
    window.onload=s howDoc2;
    function showDoc2()
    {
    if (document.getEl ementById(id);)
    {
    parent.doc1div. style.height="3 00";
    }
    else
    {
    parent.doc1div. style.height="4 0";
    }
    }
    -->
    </script>
    </head>

    <body>
    <div id="doc2div1" z-index:500 position=absolu te>
    <dl><dt onMouseOver="ja vascript:showDo c2();">
    <!-- content -->
    </dt></dl></div>
    </body>
    </html>[/HTML]
    Last edited by gits; Aug 12 '08, 08:48 PM. Reason: added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use document.getEle mentById() to access elements. Just because you gave the element an ID doesn't mean you can access them by ID globally. IE's behaviour is incorrect here.

    Comment

    Working...