iframe help

Status
Not open for further replies.

WHWebSolutions

In Runtime
Messages
128
Hello all I have this iframe code
Code:
 <iframe src ="test.php" width="100%" height="75%" frameborder=0 scrolling="yes"></iframe>
now in IE everything looks fine but in Firefox the frame is way to small. as you see it says 75% but in FF it looks like only 10% maybe 15%. Can someone help me out with this please?

William
 
try putting your iframe inside a
Code:
<table>
tag and setting your iframe width and height to 100% and set your table size to 100% and 75% - table tags seem to be a little more cross compatible - not sure if it will work or not but just my initial thought

your option is to use CSS and use both IE and Firefox coding standards, you can list both code side by side and it will work
 
ok i did that
Code:
<table width="100%" height="75%" border="0">
  <tr>
    <td><div align="center">
      <iframe src ="test.php" width="100%" height="100%" frameborder=0 scrolling="yes"></iframe>
    </div></td>
  </tr>
</table>
and it still looks the same
 
i think the problem may be that mozilla doesn't read % signs so when you say 80% mozilla readx it as 80px - so another option might be to use javascript function on the iframe load event

try something like this, i'm not sure if this function it self would work i just did off the top of my head but this is generally what you'd want to do
Code:
function IframeLoad(iframeName){
var screenWidth = screen.availWidth;
 if(navigator.appName != "Microsoft Internet Explorer")
{
      window.frames[iframeName].width = screenWidth*.8;
 }
}
 
Status
Not open for further replies.
Back
Top Bottom