The FRAMESET Element


The <FRAMESET> Element

I'll take a look at the <FRAMESET> element from the JavaScript point of view here. As with the other HTML elements we'll see, JavaScript's core HTML properties, methods , and events (covered throughout Chapters 5 and 6) apply to this element. Besides those core HTML properties, the <FRAMESET> element supports the JavaScript properties you see in overview in Table 7.4 and covered in depth in Table 7.5. We'll see methods and events for this element in the next chapter.

Table 7.4. Overview of the Properties of the <FRAMESET> Element (See Chapter 5 and 6 for the JavaScript core HTML properties, methods, and events that also apply to this element.)

Properties

     

border

borderColor

cols

frameBorder

frameSpacing

rows

   
Table 7.5. The Properties of the <FRAMESET> Element (See Chapter 5 and 6 for the JavaScript core HTML properties, methods, and events that also apply to this element.)

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

border

           

x

x

x

x

 

Read/write

 

Holds the thickness of the frames ' borders, in pixels.

borderColor

           

x

x

x

x

 

Read/write

 

Holds the color of the frameset's border (the BORDERCOLOR attribute). Set to a color the browser can recognize (color triplet or predefined color). See the tip following this table for more information.

cols

     

x

   

x

x

x

x

 

Read/write

 

Using this value, you can actually change the COLS attribute of a <FRAMESET> element, changing the space distribution of columns in the element. Set this property to any valid COLS attribute value (including percent signs and asterisks ).

frameBorder

           

x

x

x

x

 

Read/write

 

Specifies the value of the FRAMEBORDER attribute. May be set to "yes," "no," 1, or 0.

frameSpacing

           

x

x

x

x

 

Read/write

 

Holds the value of the FRAMESPACING attribute. Sets the spacing in pixels between frames.

rows

     

x

   

x

x

x

x

 

Using this value, you can actually change the ROWS attribute of a <FRAMESET> element, changing the space distribution of rows in the element. Set this property to any valid ROWS attribute value (including percent signs and asterisks).

Tip

Plenty of the JavaScript properties we'll see in this book, such as the <FRAMESET> object's borderColor property, correspond to HTML attributes used to set the colors displayed in a browser. You assign these properties colors that the browser can recognize (using the same values you would assign to HTML color attributes)that is, a hexadecimal color triplet or a predefined color. Here are some examplesthe hexadecimal color triplet "ff0000" is pure red, "ffffff" is bright white, "000000" is black, "00ff00" is bright green, and "808080" is gray. The red, green, and blue values here, rr , gg , and bb (each of which can go from 00 to ff in hexadecimal) are assembled into a color triplet: rrggbb . You also can use predefined colors (which differ by browser) such as "red," "yellow," "blue," or "pink".


Note the power you have in Table 7.5using the cols and rows properties of <FRAMESET> objects in JavaScript, you can modify the COLS and ROWS attributes of <FRAMESET> elements, changing your frame layout on-the-fly .



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

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