Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts

    Question Find px height of iFrame, post in DIV on parent frame.

    I had this code years ago, and can't find it.

    Info:
    http://arctic.ithium.net/

    Browser>Frame>iFrame
    index.html>center.php>fr1.name.html


    I need a code that would tell me the px height of any on-site pages that are loaded into the iFrame (named "frame1"), and post that information onto the main framed (center.php named "center") page inside a DIV.

    From what I remember, there was a JS on each iFrame page that would post the info, but I can't remember how exactly it does it.

    Does anyone have a copy of this (3-5 years old), or can someone help design anew? IE5.5+ preffered, but cross-browser interested.


    Tanx!
    <div> - putting your mind in a box since 1997

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Try in parent

    top.frames['iframename'].document.getElementsByTagName('body')[0].scrollHeight
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts
    Thanks.

    Yet I need it to be updated each time a page loads inside said iFrame.
    <div> - putting your mind in a box since 1997

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Try
    function findHeight(){
    iHeight = top.frames['iframename'].document.getElementsByTagName('body')[0].scrollHeight
    }
    ...
    <iframe onload="findHeight()" name="iframename"></iframe>
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts

    Lightbulb

    I'm not getting it...

    I did find a little of what I was doing years ago:
    Target outside the iFRAME (parent)

    I've also found the original code that would find the size od a DIV and display it inside another DIV somewhere else on the original page (no iFrames)...


    Now before I forget where I was going with this again; can I get the scrollHeight of any of my pages that load into the iFrame to display inside a SPAN tag on the page the iframe is sitting on?


    Here's the old original code, colours in red are the actual parts that seem to matter:

    <HTML>

    <HEAD>

    <style>

    #wn1 {

    background-color: #000000;
    border-color: #000000 #ffffff;
    border-style: solid;
    border-width: 0px 1px;
    clip:rect(0px, 200px, 149px, 0px);
    color: #ffffff;
    font-family: arial;
    font-size: 9px;
    filter:alpha(opacity=70);
    height:149px;
    left:10px;
    margin: 0px;
    -moz-opacity: 0.75;
    padding: 1px 3px;
    position:absolute;
    top:100px;
    width: 150px;
    z-index:1;
    }



    #wn2
    {
    background-color: #000000;
    border-color: #000000 #ffffff;
    border-style: solid;
    border-width: 0px 1px;
    clip:rect(0px, 200px, 149px, 0px);
    color: #ffffff;
    font-family: arial;
    font-size: 11px;
    filter:alpha(opacity=70);
    height:149px;
    left:10px;
    margin: 0px;
    -moz-opacity: 0.75;
    padding: 1px 3px;
    position:absolute;
    top:100px;
    width: 150px;
    z-index:2;
    }



    #wn3
    {
    background-color: #000000;
    border-color: #ffffff #ffffff #000000;
    border-style: solid;
    border-width: 1px 1px 0px;
    clip:rect(0px, 540px, 364px, 0px); width:540px; height:364px;
    color: #ffffff;
    font-family: arial;
    font-size: 12px;
    filter:alpha(opacity=60);
    left:195px;
    margin: 0px;
    -moz-opacity: 0.6;
    padding: 0px;
    position:absolute;
    top:20px;
    z-index:3;
    }



    .content
    {
    left:0;
    padding:0px 10px;
    position:absolute;
    top:0;
    width:540px;
    z-index:1;
    }


    TABLE.info
    {
    font-family: arial;
    font-size: 11px;
    width: 130px;
    }


    TABLE.scroll
    {
    color:#ff0000;
    font-family: arial;
    font-size: 9px;
    }
    </style>

    <BODY>

    <DIV CLASS="title" STYLE="position:absolute; width: 150px; left:20px; top:20px; text-align:center;">

    main.menu

    </DIV>

    <div id="wn1" STYLE="position:absolute; left:20px; top:35px; ">

    <div id="w1c1" class="content">


    <table CLASS="info" WIDTH="130" cellpadding="0" cellspacing="0" onMouseover="changeto('#333333')" onMouseout="changeback('#000000')">

    <TR><TD width="100%"> <A HREF="javascript:void(0);" STYLE="width:100%"> home</A> </TD></TR>

    </TABLE>

    <BR>

    <table CLASS="info" WIDTH="130" cellpadding="0" cellspacing="0" onMouseover="changeto('#333333')" onMouseout="changeback('#000000')">

    <TR><TD>

    <A HREF="About.html" STYLE="width:100%"> about us</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> springfield, mo</A> </TD></TR>

    </TABLE>

    <BR>

    <table CLASS="info" WIDTH="130" cellpadding="0" cellspacing="0" onMouseover="changeto('#333333')" onMouseout="changeback('#000000')">

    <TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> citizens band radio</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> ham/amatuer radio</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> pirates operator info</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> coaxial cable/connectors</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> antennas</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> dx contacts</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> local links</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> other links</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> frequencies</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> free banding</A> </TD></TR><TR><TD>

    <A HREF="javascript:void(0);" STYLE="width:100%"> .....</A> </TD></TR>

    </TABLE>

    </div>

    </div>


    <DIV CLASS="cap" STYLE="position:absolute; width: 150px; left:20px; top:184px;">

    <TABLE CLASS="scroll" CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%">

    <TR><TD ALIGN="left" STYLE="color:#666666; ">

    &nbsp;

    <!--[if gte IE 5]>

    h.<span id="moredivs1"> . . . </span>

    <script language="JavaScript">

    if (document.all){

    setTimeout("document.all.moredivs1.innerHTML=w1c1.clientHeight+2", 1);

    }

    </script>

    <![endif]-->


    </TD><TD ALIGN="right">

    scroll: .

    <a href="javascript:void(0);"

    onmousedown="inchUp(0,3); window.status='Hover here to scroll up.'; return true"

    onmouseup="stopScroll(); window.status=''"

    onmouseout="stopScroll(); window.status=''">up</a>.

    <a href="javascript:void(0);"

    onmousedown="inchDown(0,3); window.status='Hover here to scroll down.'; return true"

    onmouseup="stopScroll(); window.status=''"

    onmouseout="stopScroll(); window.status=''">down</a>.

    </TD></TR>

    </TABLE>

    </DIV>

    <DIV CLASS="title" STYLE="position:absolute; width: 150px; left:20px; top:220px; text-align:center;">

    channel.21.community

    </DIV>

    <div id="wn2" STYLE="position:absolute; left:20px; top:235px; ">

    <div id="w2c1" class="content">


    our channels:

    <BR>

    16: 27.115mhz <SUP><U>lsb</U></SUP><BR>

    21: 27.215mhz <SUP><U>am</U></SUP><BR>

    **: 27.455mhz <SUP><U>lsb</U></SUP><BR>

    <BR>

    first online:<BR>

    21 february '99<BR>

    <BR>

    location:<BR>

    springfield, mo<BR>

    -united states-<BR>

    <BR>

    </div>

    </div>


    <DIV CLASS="cap" STYLE="position:absolute; width: 150px; left:20px; top:384px;">

    <TABLE CLASS="scroll" CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%">

    <TR><TD ALIGN="left" STYLE="color:#666666; ">

    &nbsp;

    <!--[if gte IE 5]>

    h.<span id="moredivs2"> . . . </span>

    <script language="JavaScript">

    if (document.all){

    setTimeout("document.all.moredivs2.innerHTML=w2c1.clientHeight+2", 1);

    }

    </script>

    <![endif]-->


    </TD><TD ALIGN="right">

    scroll: .

    <a

    href="javascript:void(0);"

    onmousedown="inchUp(1,3); window.status='Hover here to scroll up.'; return true"

    onmouseup="stopScroll(); window.status=''"

    onmouseout="stopScroll(); window.status=''">up</a>.

    <a href="javascript:void(0);"

    onmousedown="inchDown(1,3); window.status='Hover here to scroll down.'; return true"

    onmouseup="stopScroll(); window.status=''"

    onmouseout="stopScroll(); window.status=''">down</a>.

    </TD></TR>

    </TABLE>

    </DIV>

    <div id="wn3">

    <div id="w3c1" class="content">


    <P>&nbsp;</P>

    <B>springfield.dx -</B><I> v5.0</I>

    <table border="0" cellspacing="0" width="100%" style="Filter:Alpha(Opacity=100,FinishOpactiy=0,style=1)">

    <tr><td bgcolor="#FF0000"></td></tr></table>

    <p>This site is provided as a resource for CB, HAM, and Pirate radio operators worldwide. With a unique mix of technical information and style, the site is designed to deliver a compelling and immersive web experience. Once fully operational, Springfield DX will serve as the contact point for all Springfield information regarding CB/HAM use, clubs, technical information, chat, and more! Visitors and guests are encouraged to submit any information which they would like seen on the site - this includes DX contacts, radio and antenna tweaks, other technical information, upcoming group meetings or 'foxhunts', as well as any FCC rule or regulation news.

    Please visit again soon, as this site is still under <i>extensive</i> redesign...

    <BR><BR><BR><BR>


    </P>


    </div>

    </div>


    <DIV CLASS="cap" STYLE="position:absolute; width: 540px; left:195px; top:384px;">

    <TABLE CLASS="scroll" CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%">

    <TR><TD ALIGN="left" STYLE="color:#666666; ">

    &nbsp;

    <!--[if gte IE 5]>

    h.<span id="moredivs3"> . . . </span>

    <script language="JavaScript">

    if (document.all){

    setTimeout("document.all.moredivs3.innerHTML=w3c1.clientHeight+2", 1);

    }

    </script>

    <![endif]-->


    </TD><TD ALIGN="right">

    scroll: .

    <a href="javascript:void(0);"

    onmousedown="inchUp(2,3); window.status='Hover here to scroll up.'; return true"

    onmouseup="stopScroll(); window.status=''"

    onmouseout="stopScroll(); window.status=''">up</a>.

    <a href="javascript:void(0);"

    onmousedown="inchDown(2,3); window.status='Hover here to scroll down.'; return true"

    onmouseup="stopScroll(); window.status=''"

    onmouseout="stopScroll(); window.status=''">down</a>.

    </TD></TR>

    </TABLE>

    </DIV>

    </BODY>

    </HTML>

    <div> - putting your mind in a box since 1997


  •  

    Posting Permissions

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