coolbutton Behavior

This topic documents a feature of Binary Behaviors, which are obsolete as of Internet Explorer 10.

Adds a coolbutton control to the document.

Syntax

XML
  	<Prefix:

CustomTag ID=sID STYLE="behavior:url('coolbutton.htc')" />

HTML <ELEMENT STYLE="behavior:url('coolbutton.htc')" ID=sID>
Scripting object.style.behavior = "url('coolbutton.htc')"
object.addBehavior ("coolbutton.htc")

Possible Values

Prefix Prefix that associates the CustomTag with an XML namespace. This prefix is set using the XMLNS attribute of the HTML tag.
CustomTag User-defined tag.
sID String that specifies a unique identifier for the object.

Members Table

The following table lists the members exposed by the coolbutton object.

Attribute Property Description
cb--border-style cbBorderStyle Specifies the rendered border style for the coolbutton behavior.
cb--border-width cbBorderWidth Specifies the width of the button border for the coolbutton behavior.
cb--hover-background cbHoverBackground Specifies the color of the background to display when the mouse cursor hovers over the coolbutton behavior.
cb--hover-border cbHoverBorder Specifies the border to display when the mouse cursor hovers over the coolbutton behavior.
cb--hover-color cbHoverColor Specifies the color of the text to display when the mouse cursor hovers over the coolbutton behavior.
cb--selected-background cbSelectedBackground Specifies the color of the background to display when the coolbutton behavior is selected.
cb--selected-border cbSelectedBorder Specifies the border to display when the coolbutton behavior is selected.
GROUP group Specifies that the button belongs to a group that acts exclusively for the coolbutton behavior.
HOVERIMAGE hoverImage Specifies the image source to display when the mouse hovers over the coolbutton behavior.
IMAGE image Specifies the image source to display for the coolbutton behavior.
STATE state Retrieves whether the button is pressed for the coolbutton behavior.
TYPE type Sets or retrieves the ToolTip that is displayed when the mouse hovers over the coolbutton behavior.

Remarks

The behavior-defined members listed in the preceding table are not accessible through script until the window. onload event fires. Waiting for this event to fire ensures that the document is completely loaded, that all behaviors have been applied to corresponding elements on the document , and, consequently, that all the behavior's properties, methods, and events are available for scripting. Attempting to use any of the behavior-defined members will result in a scripting error indicating that the object does not support that particular member.

The coolbutton behavior can be used only within the coolbar behavior.

The coolbutton behavior inserts a button into a document , as a part of the coolbar behavior. It provides a visual cue in the form of an icon and/or a text cue in the form of a label indicating which action will be performed. Both the icon and the text can be assigned hover effects for the onmouseout event. The coolbar behavior defaults to a familiar Microsoft Win32 style, but can be edited with a full range of Dynamic HTML and cascading style sheets (CSS) properties. These properties can be set at run time so an application can allow the user to turn on and off the text labels on the buttons, as with Windows Internet Explorer.

The coolbutton.htc file can be downloaded from the coolbar  sample page.

In addition to the members and styles previously listed, the coolbutton behavior supports:

Example

This sample demonstrates the implementation and adjustments of the coolbutton behavior.

<HTML XMLNS:IE>
<HEAD>
<STYLE>
IE\:Coolbutton{
   behavior: url(/behaviors/coolbutton.htc) ;
}
IE\:Coolbar{
   behavior: url(/behaviors/coolbar.htc) ;
}
</STYLE>
</HEAD>
<BODY>

<IE:Coolbar
   ID = "oCB"
   SIZEALL = "true"
   STYLE = "padding: 5px;"
>

<IE:Coolbutton
   ID = "oCButton1"
>
Button Label
</IE:Coolbutton>

</IE:Coolbar>
</BODY>
</HTML>

Code example: https://samples.msdn.microsoft.com/workshop/samples/author/behaviors/library/coolbar/coolbar_js.htm

See Also

Introduction to DHTML Behaviors, Using DHTML Behaviors