jagku
asked on
how to increase height of a parent div
Hello Experts,
I have 2 html files:
Parent:
<div id="mainframe" style="height:120px; width:500px">
<iframe class="login" src="login.html" scrolling="no" frameborder="0" width="100%" height="100%" >
</iframe>
</div>
Child: (login.html)
I call this script in the the <body onload>:
function resizeFrame()
{
if ($('#mainframe',window.par ent.docume nt).length > 0)
{
$('#mainframe',window.pare nt.documen t).attr("s tyle","hei ght:220px; width:500px");
}
}
The purpose of this script is to resize the div that wraps the iframe (as I need to float the iframe at the top of the screen). For some reason my jquery isn't resizing the mainframe. What am I doing wrong?
Thanks
I have 2 html files:
Parent:
<div id="mainframe" style="height:120px; width:500px">
<iframe class="login" src="login.html" scrolling="no" frameborder="0" width="100%" height="100%" >
</iframe>
</div>
Child: (login.html)
I call this script in the the <body onload>:
function resizeFrame()
{
if ($('#mainframe',window.par
{
$('#mainframe',window.pare
}
}
The purpose of this script is to resize the div that wraps the iframe (as I need to float the iframe at the top of the screen). For some reason my jquery isn't resizing the mainframe. What am I doing wrong?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Actually, the way I was adjusting the height was incorrect. It should have been
eg
$('#mainframe',window.pare nt.documen t).height( 320);
eg
$('#mainframe',window.pare
http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
Read the above. It might solve your problem. It may introduce a new one though that the page needs to redraw. jQuery easily solves this so just Google jQuery and page refresh.