Frames

Team-Fly

Frames are a way to break the Web page into areas that can be separately updated. The frame feature requires the elements <FRAMESET>, <FRAME>, and <NOFRAMES>. The concept of frames is a little more difficult to grasp than the rest of HTML, and functions like refreshing of screens or printing can prove troublesome for the user.

Frameset Element

Basically the <FRAMESET> element replaces the <BODY> element in the standard <HTML> file. This element has two main attributes, Rows and Cols, and they are mutually exclusive (you cannot define both attributes for the same <FRAMESET> element).

The values of the Rows or Cols attributes are separated by commas and can be in pixels or percentage of the total browser window space. For example, rows=“100,150,80” defines three frames with heights of 100, 150, and 80 pixels, respectively, within the browser window. If the browser’s window has more or fewer pixels, it will figure out the ratios to provide the specified appearance. Percentage of window is indicated by simply adding a percent sign (%) behind each number (rows=“70%,30%”).

Framesets can be nested within one other; thus if we want two rows of three frames each (a total of six separately updateable areas on the browser), the HTML for the main file would look something like this:

<!—File: main.html ‡ <html> <title>MAIN.HTML</title> <frameset rows="50%,50%"> <!—two rows ‡     <frameset cols="33%,33%,33%"> <!—3 cols, top row ‡         <frame src="/books/1/557/1/html/2/green.html" name="green">         <frame src="/books/1/557/1/html/2/red.html" name="red">         <frame src="/books/1/557/1/html/2/blue.html" name="blue">     </frameset>     <frameset cols="33%,33%,33%"> <!—3 cols, bottom row ‡         <frame src="/books/1/557/1/html/2/yellow.html" name="yellow">         <frame src="/books/1/557/1/html/2/white.html" name="white">         <frame src="/books/1/557/1/html/2/orange.html" name="orange">     </frameset> </frameset> </html>

The preceding example would create a browser window with the following frames:

Green

Red

Blue

Yellow

White

Orange

The rules for figuring out which frame is going to appear where are fairly simple. Frames cannot overlap, and they are calculated from the top down and from left to right. We start from the top of the HTML code, and when we have filled up a portion of the screen, we proceed to the next.

Frame Element

The <FRAME> element defines the basic characteristics of one section of the browser window that was defined with the <FRAMESET> element. The attributes that can be applied to the <FRAME> element include the following:

  • Name. Specifies the name of the frame, and must be unique within one HTML page. The target attribute of the anchor elements uses the name to update the data in this frame.

  • SRC. Specifies a URL pointing to an HTML page that contains the initial contents of the frame.

  • Marginheight. Specifies the number of pixels between frames (vertically).

  • MarginWidth. Specifies the number of pixels between frames (horizontally).

  • Noresize. Has no value assigned to it. If this attribute is in the <FRAME> definition, then the user will not be able to resize this frame (which can effectively stop resizing on many adjacent frames).

  • Scrolling. Has either the value of yes (default) or no.

Noframes Element

The <NOFRAMES> element displays a screen if the browser does not support the <FRAME> element. The body statement can be used within the <NOFRAMES> element.

<noframes> <body> <p>This screen has frames which are not supported/enabled by your current browser.</p> </body> </noframes>


Team-Fly


Java & BAPI Technology for SAP
Java & BAPI Technology for SAP
ISBN: 761523057
EAN: N/A
Year: 1998
Pages: 199

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net