Click to return to the DHTML, HTML     
cb--border-style Attribut...     Behaviors Library    
Web Workshop  |  DHTML, HTML & CSS

coolbutton Behavior


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>
Scriptingobject.style.behavior = "url('coolbutton.htc')"
object.addBehavior ("coolbutton.htc")

Possible Values

Prefix Prefix used to associate CustomTag with a namespace. This prefix is set using the XMLNS attribute of the HTML element.
CustomTag User-defined tag.
sID String that uniquely identifies the object.

Members

Styles

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 page is completely loaded, that all behaviors have been applied to corresponding elements on the page, 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 Web page, 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 Microsoft® Internet Explorer.

The coolbutton.htc file can be downloaded from the coolbutton 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>
This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

See Also

DHTML Behaviors, Using DHTML Behaviors



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.