Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-30-2006, 12:47 PM   PM User | #1
Srikanth.S
New Coder

 
Join Date: May 2005
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Srikanth.S is an unknown quantity at this point
Changing IFRAME height in Mozilla & FF

Hi All,

I'm loading a DIV element over an IFRAME, the DIV element contains a table in which I'm dynamically creating table rows. The DIV element height icreases on dynamic row creation, simultaneously the IFRAME height has to be increased to the DIV element height. I tried the following code,

Code:
document.getElementById('testIframe').style.height = document.getElementById('testDiv').offsetHeight;
it works well in IE & Opera but not in Mozilla & FireFox.

How to increase IFRAME height dynamically as I said above in Mozilla & FireFox.
__________________
Thanks & Regards,
Srikanth S
Srikanth.S is offline   Reply With Quote
Old 08-30-2006, 03:00 PM   PM User | #2
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,355
Thanks: 3
Thanked 458 Times in 445 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


<head>
  <title></title>
</head>

<body>
<iframe id="fred" src="a.htm" width="800" height="100"></iframe>
</body>

</html>
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


<head>
  <title>a.htm</title>
<script language="JavaScript" type="text/javascript">
<!--
function Cng(){
 if (window.parent.document.getElementById('fred')){
  window.parent.document.getElementById('fred').style.height='300px';

 }

}
//-->
</script>
</head>

<body>
<div style="width:100px;height:100px;background-color:red;"
onclick="this.style.height='200px';Cng();"

></div>
</body>

</html>
__________________
Vic

God Loves You and will never love you less.

http://www.vicsjavascripts.org.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/
vwphillips is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:18 AM.


Advertisement
Log in to turn off these ads.