working with frames

liunx

Guest
Hello<br />
<br />
I am new to frames and was hoping someone could help me with some questions.<br />
<br />
Here is my frameset code:<br />
<br />
<html><br />
<frameset cols="158,*" frameborder="0" border="0" framespacing="0"><br />
<frame src=http://www.webdeveloper.com/forum/archive/index.php/"left.php" scrolling="no"><br />
<frame src=http://www.webdeveloper.com/forum/archive/index.php/"right.php" name="right"><br />
</frameset><br />
</html><br />
<br />
Note that I am loading php files in both sides of the frames.<br />
<br />
Question 1:<br />
The width of the left.php file may change based on its content and this is how it is designed (it is designed with percentages so that it could stretch if needed).<br />
I would like the left page in the frameset to take the minimal width needed to display that page without a horizontal scrollbar. However the only two methods that I know for settings the width are: cols="#%,*" or cols="#,*".<br />
Is there a way to tell it the frameset:<br />
"OK this is the page that will go on the left, give it the minimal horizontal space it needs (without a scrollbar) and give the rest of the remaining space to the right frame?"<br />
<br />
Question 2:<br />
For some reason, the page that is loaded on the right side of the frameset appears with a horizontal scrollbar, evern though it doesn't need it. When I display the right page on its own window (without a frame), I can see that no scrollbar appears, even if I resize it even smaller than it appears in the framest.<br />
Does anyone have any idea what could cause this behaviour?<br />
<br />
thanks in advance<!--content-->1. You need to check the size of the body content in the left frame in the onLoad event and then modify the frame's width dynamically.<br />
<br />
2. Sometimes the DOCTYPE declaration can cause width:100% to create a horizontal overflow. I have had some problems with this in IE only. If you have a DOCTYPE declaration, remove it and see what happens. If that doesn't fix it, add a style attribute to your body tag:<br />
<br />
<br />
<body style="overflow-x:hidden"><!--content-->
 
Back
Top