How to, using JavaScript, resize frame inside frameset?
I've found jQuery slideUp (/) function very useful, however it's not possible to implement it to work with the frame.
How to, using JavaScript, resize frame inside frameset?
I've found jQuery slideUp (http://api.jquery./slideUp/) function very useful, however it's not possible to implement it to work with the frame.
Share Improve this question edited Dec 16, 2010 at 0:49 user142162 asked Dec 16, 2010 at 0:46 PaulPaul 1,9668 gold badges25 silver badges32 bronze badges1 Answer
Reset to default 11To resize a frame, you'll have to change the rows/cols -attribute of the parent frameset-element.
Short example:
<html>
<head>
<script>
window.onload=function()
{
var frame=window.frames[0];
frame.document.open();
frame.document.write('<input type="button" \
onclick="parent.fx()" \
value="resize this frame to 150px height">');
frame.document.close();
}
var i=50;
function fx()
{
timer=setInterval(
function()
{
if(i>150)
{
clearTimeout(timer);
}
else {
document.getElementsByTagName('frameset')[0]
.setAttribute('rows',(i++)+',*');
}
}
,20)
}
</script>
</head>
<frameset rows="50,*">
<frame src="about:blank"/>
<frame src="about:blank"/>
</frameset>
</html>