Link to home
Start Free TrialLog in
Avatar of kenitech
kenitech

asked on

Firefox iframe 100% - solution

I have a solution to a problem that has been closed in a previous post but i am not sure how i can contribute this to the experts community otherwise...


iframe in firefox does not size to 100%
https://www.experts-exchange.com/questions/21300606/iFrame-100-height-for-firefox.html


function calcHeight(name)
{
  //find the height of the internal page
  document.getElementById(name).height = 0;
     
  var the_height=
    document.getElementById(name).contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById(name).height=
      the_height;
}


<iframe id="main" name="main" onLoad="calcHeight('main');" src="yourcontent.htm" height="100" width="100%" style="border:0px" FRAMEBORDER="0" scrolling="no"></iframe>


-----


it seems to not work though if you use the following in the pages:



<style type="text/css">
<!--
html, body {
height: 100%;
margin: 0;
padding: 0;
}
-->
</style>
Avatar of giltjr
giltjr
Flag of United States of America image

Have you tried adding marginwidth=1 marginheight=1 on the iframe definition?  I know you have defined that you have no borders, but you never know.  I also assume you meant to type height="100%" and not just "100".
Avatar of kenitech
kenitech

ASKER

hey, this solution works for me...i'm just sure how to 'announce' it as a solution to others. is that something that people do on experts??
There's an "Accept" button in the upper right corner of giltjr's post. Click that to accept his answer as a solution.
Ah, I think I understand.  You are not asking "How to ..."  You found a solution and want to let everybody else know.

Looking at your prior question it seems that you found what the solution was to your own question.  You posted your finding in that question.  That is all you need to do.  If somebody else is having the same problem, when they do a search they should find your prior question with the appropriate answer (that you found on your own).
kenitech,
Thank you for helping the community.  That's what we are truly here for. But you do not need to use up your points to help others.

As giltjr said, you have posted your findings in the other post.  Follow the instructions here to request a refund.

https://www.experts-exchange.com/help.jsp#hi70
I believe the original poster was actually giving the community a solution, not requesting help.

Do not Accept.  Refund Points.
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial