HTML Help Forum HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

How to change height of iframe
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum -> HTML Frame
View previous topic :: View next topic  
Author Message
sailershen



Joined: 08 Jun 2008
Posts: 1

Posted: Tue Jun 10, 2008 11:19 pm     How to change height of iframe  

My index.html:
Code:
<iframe name=top src=top.html
<iframe name=leftindex id=leftindex src=index_left.html
<iframe name=rightindex id=rightindex src=index_right.html


In top.html:
Code:
<a href="javascript:change()">change</a>

<script language="javascript">
function change() {
    document.getElementById("leftindex").height=2000px;
    document.getElementById("rightindex").height=2000px;
}


In top.html, I want change the height of the 2 iframes, the "document.getElementById" cannot change it, and "parent.leftindex.height=2000px" cannot change it also.

Who can tell me how can chang the height of iframe in top.html?
Straystudio



Joined: 14 Apr 2008
Posts: 297
Location: Nord Italy

Posted: Wed Jun 11, 2008 8:49 am      

First of all, You MUST have 2000px between QUOTATION MARKS.
And document.getElementById("leftindex").height="2000px"; already works.

Also remember, some other Elements can be sized in JavaScript via document.getElementById("").style.height=""
 
 
DARFUR
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum -> HTML Frame
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group