How to, using JavaScript, resize frame inside frameset?
I've found jQuery slideUp (http://api.jquery.com/slideUp/) function very useful, however it's not possible to implement it to work with the frame.
The noresize attribute specifies that a <frame> element cannot be resized by the user. By default, each <frame> in a <frameset> can be resized by dragging the border between the frames.
The noresize attribute specifies that a frame cannot be resized by the user.
Frames are a special case in JavaScript — each frame behaving like the separate document that it is. This means that to modify anything in another frame, you first need to gain control of this frame by working with something called the frame tree.
The HTML <frame> noresize attribute is used to specify that the frame element can not be resize by the user. This type of attribute is used to lock the size of the frame element. Attribute Values: noresize: It defines the frame element that can not be resize by the user.
To 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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With