ForeColor Property
The ForeColor property contains the color of the text.
Syntax
document.all["id_name"].ForeColor [=color]
|
Possible Values
ColorValue that specifies or retrieves the text color.
|
The property is read/write.
Remarks
ColorValue: An RGB (Red, Green, Blue) 32-bit color value that defines
a solid color. Each of the Red, Green, Blue portions represents the color intensity between
0 and 255 (or 0x00 to 0xff hexadecimal). The RGB color value can be calculated: ColorValue =
Red + Green*256 + Blue*65536. Please note that this representation differs from HTML color
values, which are hexadecimal RRGGBB.
Examples
The following example changes the ForeColor property depending on the specified color.
<html>
<head>
<SCRIPT TYPE="text/javascript">
function changeForeColor()
{
if(document.all["id_StaticText"].ForeColor == 0)
{
document.all["id_StaticText"].ForeColor = 241745845;
}
else
{
document.all["id_StaticText"].ForeColor = 0;
}
}
</SCRIPT>
</head>
<body>
<OBJECT id="id_StaticText" width="170" height="12"
style="padding:0; margin:0; display:inline;"
classid="CLSID:2D6F85AB-07AB-4417-85E3-7F2400474A63">
<PARAM NAME="BackStyle" VALUE="0">
<PARAM NAME="BackColor" VALUE="0">
<PARAM NAME="FontName" VALUE="Times New Roman">
<PARAM NAME="FontSize" VALUE="8.00">
<PARAM NAME="FontBold" VALUE="0">
<PARAM NAME="FontItalic" VALUE="0">
<PARAM NAME="FontUnderline" VALUE="0">
<PARAM NAME="FontWeight" VALUE="500">
<PARAM NAME="ForeColor" VALUE="0">
<PARAM NAME="Text" VALUE="Default text if necessary">
</OBJECT>
<div onclick="changeForeColor()">Click to change colors!</div>
</body>
</html>
|
Applies to
SiteKiosk v5.0 (and later versions).
Back to top