Need help with a frameset

Drawen

New Member
So, ive made a frameset with 1 upper row and 2 cols below it, but it is described as a percentage of the web browser in html, i was wondering is there a way to designate the frames by the pixels of the image i want to display rather than a percentage, because with the percentage it looks great on 1 computer and looks like hell on the next one because half the top image is cut off. i am actually looking to make a frameset now that looks like this

--------------------------------------------------------------------------
|Top Frame Image Goes HereTop Frame Image Goes HereTop Frame Image G|
|Top Frame Image Goes HereTop Frame Image Goes HereTop Frame Image G|
|Top Frame Image Goes HereTop Frame Image Goes HereTop Frame Image G|
--------------------------------------------------------------------------
|NavBarNavBarNavBarNavBarNavBarNavBarNavBarNavBarNavBarNavBarNavBar|
|NavBarNavBarNavBarNavBarNavBarNavBarNavBarNavBarNavBarNavBarNavBar|
--------------------------------------------------------------------------
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
|MainContentMainContentMainContentMainContentMainContentMainContent |
--------------------------------------------------------------------------
and i want the frames designated space to be defined by pixels, is there some way to do this?
 
Last edited:

rarepearldesign

New Member
Frameset Page
Code:
 - Note the ID defined on the frameset
<html>
<head runat="server">
    <title>Untitled Page</title>
</head>
    <FRAMESET id="MyFrameSet" ROWS="20%,20%,*">
      <FRAME NAME="HeaderFrame" SRC="Header.aspx" scrolling="no" noresize="noresize">
      <FRAME NAME="NavBarFrame" SRC="NavBar.aspx">
      <FRAME NAME="ContentFrame" SRC="Content.aspx">
      <NOFRAMES>
        <BODY>
          
        </BODY>
      </NOFRAMES>
    </FRAMESET>
</html>

Header Frame
- Note the code to change the row definition of the frameset
Code:
<html>
<head runat="server">
    <title>Untitled Page</title>
    <style>
        BODY {margin:0px;top:0px;padding:0px;}
    </style>
    <script type="text/javascript">
        function updateHeaderFrameSize() {
            // Reference the parent window frameset, and modify the row definition
            // Note: I used a style to ensure there was no extra padding around the header, if you 
            // have padding you must account for that in the height you are setting
            parent.document.getElementById("MyFrameSet").rows = document.getElementById("imgHeader").height + ",20%,*";
        }
    </script>
</head>
<body onload="updateHeaderFrameSize()">
    <img id="imgHeader" src="..." />
</body>
</html>

Hope it helps!
 

rarepearldesign

New Member
Whoa, I just overkilled your problem. I thought you wanted to change the top frame dynamically based on the image in the header.

If you just want to set the size of the frame for a known image size, don't put the % in the definition.
 
Top