The SpryCollapsiblePanel.css file provides the default styling for the Collapsible Panel widget. You can, however, easily customize the widget by changing the appropriate CSS rule. The CSS rules in the SpryCollapsiblePanel.css file use the same class names as the related elements in the collapsible panel’s HTML code, so it’s easy for you to know which CSS rules correspond to the different sections of the Collapsible Panel widget. Additionally, the SpryCollapsiblePanel.css file contains class names for widget behaviors (for example, hovering and clicking behaviors).
The SpryCollapsiblePanel.css file should already be included in your website before you start customizing. For more information, see Prepare your files.
**This sentence is a sample change for LiveDocs.**
Set properties for the entire Collapsible Panel widget container, or set properties for the components of the widget individually.
You can replace style-related class names in the SpryCollapsiblePanel.css file and HTML code with class names of your own. Doing so does not affect the functionality of the widget.
The SpryCollapsiblePanel.css file contains extensive comments, explaining the code and the purpose for certain rules. For further information, see the comments in the file.
Set properties for the entire Collapsible Panel widget container, or set properties for the components of the widget individually.
Style to change |
Relevant CSS rule |
Example of properties and values to add or change |
---|---|---|
Text in the entire collapsible panel |
.CollapsiblePanel |
font: Arial; font-size:medium; |
Text in panel tab only |
.CollapsiblePanelTab |
font: bold 0.7em sans-serif; (This is the default value.) |
Text in content panel only |
.CollapsiblePanelContent |
font: Arial; font-size:medium; |
Color to change |
Relevant CSS rule |
Example of property and value to add or change |
---|---|---|
Background color of panel tab |
.CollapsiblePanelTab |
background-color: #DDD; (This is the default value.) |
Background color of content panel |
.CollapsiblePanelContent |
background-color: #DDD; |
Background color of tab when panel is open |
.CollapsiblePanelOpen .CollapsiblePanelTab |
background-color: #EEE; (This is the default value.) |
Background color of open panel tab when the mouse pointer moves over it |
.CollapsiblePanelTabHover, .CollapsiblePanelOpen .CollapsiblePanelTabHover |
background-color: #CCC; (This is the default value.) |
By default, the Collapsible Panel widget expands to fill available space. To constrain the width of a Collapsible Panel widget, set a width property for the collapsible panel container.
To set the height of a collapsible panel, add a height property to the CollapsiblePanelContent rule or the CollapsiblePanel rule.
The collapsible panel widget includes a few predefined behaviors. These behaviors consist of changing CSS classes when a particular event occurs. For example, when a mouse pointer hovers over a collapsible panel tab, Spry applies the CollapsiblePanelTabHover class to the widget. (This behavior is similar to a:hover for links.) The behaviors are blank by default; to change them, add properties and values to the rules.
<script type="text/javascript"> var CP2 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel2", { hoverClass: "hover", openClass: "open", closedClass: "closed", focusedClass: "focused" }); </script>
By default, a collapsible panel uses animation to smoothly open and close.
<script type="text/javascript"> var CP5 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel5", { enableAnimation: false }); </script>
You can change the time it takes for a panel to open. Set the time in milliseconds (1000 = 1 second). By default, Spry uses 500 milliseconds.
<script type="text/javascript"> var CP9 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel9", { duration: 100 }); </script>