...

View Full Version : hiding frames



phani
10-11-2003, 11:32 AM
Hi,

I have a problem while hiding frames. first iam splitting the page into two frames. on load of the page i want to hide the second frame. and clicking on the button of the first frame i want to show the second frame. i am able to hide the frame on load only. but the area intended for the second frame is still showing . i want to cover the area intended for the second frame by the first frame if the second frame is hidden . Here is the code that i used for hiding the second frame on load of the page.


<frameset rows="50%,*" frameborder="No" border="0" framespacing="0" rows="*" noresize>

<frame name="3top" scrolling="yes" src="<%=msrc%>" noresize>

<frame name="3main" scrolling="yes" src="<%=dsrc%>" style="display:'none';" noresize>

</frameset>


phani

glenngv
10-11-2003, 12:00 PM
<html>
<frameset id="myFrameSet" rows="100%,*" frameborder="No" border="1" framespacing="0" noresize>
<frame name="3top" scrolling="yes" src="<%=msrc%>" noresize>
<frame name="3main" scrolling="yes" src="<%=dsrc%>" noresize>
</frameset>
</html>

then in the first frame where the Show/Hide Frame button is:


<html>
<head>
<script type="text/javascript">
function showHideFrame(objBtn){
var rowValue;
if (objBtn.value=="Hide Frame"){
objBtn.value="Show Frame";
rowValue='100%,*';
}
else {
objBtn.value="Hide Frame";
rowValue='50%,*';
}
top.document.getElementById('myFrameSet').setAttribute('rows',rowValue);
}
</script>
</head>
<body>
<form>
<input type="button" value="Show Frame" onclick="showHideFrame(this)">
</form>
</html>


setting the rows attribute to "100%,*" will hide the bottom frame and setting back to "50%,*" will show it.

phani
10-11-2003, 01:36 PM
Thank u that was what i intended



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum