Collapsible set Widgetversion added: 1.0
Description: Creates a collapsible set of collapsible blocks of content
Collapsible sets start with the exact same markup as individual collapsibles.
By adding a parent wrapper with a data-role="collapsible-set"
attribute around a number of collapsibles, the framework will style these to looks like a visually grouped widget and make it behave like an accordion so only one section can be open at a time.
By default, all the sections will be collapsed. To set a section to be open when the page loads, add the data-collapsed="false"
attribute to the heading of the section you want expanded.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
|
Here is an example of a collapsible set with 5 sections.
Non-inset collapsible sets
For full width collapsibles without corner styling add the data-inset="false"
attribute to the set.
Mini collapsible sets
For a more compact version that is useful in tight spaces, add the data-mini="true"
attribute to the set to create a mini version.
Custom icons
Collapsible headings’ default icons can be overridden by using the data-collapsed-icon
and data-expanded-icon
attributes, either at the collapsible-set
level or on an individual collapsible basis.
Icon positioning
Collapsible headings’ default icon positioning can be overridden by using the data-iconpos
attribute, either at the collapsible-set
level or on an individual collapsible basis.
Theming collapsible content
The standard data-theme
attribute can be used to set the color of each collapsible in a set. To provide a clearer visual grouping of the content with the headers, add the data-content-theme
attribute with a swatch letter. This adds a themed background color and border to the content block. For consistent theming, add these attributes to the parent collapsible set.
1
|
|
Theming individual sections
To have individual sections in a group styled differently, add data-theme
and data-content-theme
attributes to specific collapsibles.
Expanding or collapsing items in a set
To expand or collapse items in a set, call the respective methods on individual collapsibles. The selector for the collapse method can include multiple items in a set:
1
|
|
Options
collapsedIcon
"plus"
This option is also exposed as a data attribute: data-collapsed-icon="arrow-r"
.
Initialize the collapsibleset with the collapsedIcon
option specified:
1
2
3
|
|
Get or set the collapsedIcon
option, after initialization:
1
2
3
4
5
|
|
corners
true
This option is also exposed as a data attribute:data-corners="false"
.
Initialize the collapsibleset with the corners
option specified:
1
2
3
|
|
Get or set the corners
option, after initialization:
1
2
3
4
5
|
|
expandedIcon
"minus"
This option is also exposed as a data attribute: data-expanded-icon="arrow-d"
.
Initialize the collapsibleset with the expandedIcon
option specified:
1
2
3
|
|
Get or set the expandedIcon
option, after initialization:
1
2
3
4
5
|
|
iconpos
"left"
Possible values: left, right, top, bottom, none, notext.
This option is also exposed as a data attribute: data-iconpos="right"
.
Initialize the collapsibleset with the iconpos
option specified:
1
2
3
|
|
Get or set the iconpos
option, after initialization:
1
2
3
4
5
|
|
initSelector
":jqmData(role='collapsible-set')"
1
2
3
|
|
inset
true
This option is also exposed as a data attribute: data-mini="true"
.
Initialize the collapsibleset with the inset
option specified:
1
2
3
|
|
Get or set the inset
option, after initialization:
1
2
3
4
5
|
|
mini
false
This option is also exposed as a data attribute: data-inset="false"
.
Initialize the collapsibleset with the mini
option specified:
1
2
3
|
|
Get or set the mini
option, after initialization:
1
2
3
4
5
|
|
theme
null, inherited from parent
Possible values: swatch letter (a-z).
This option is also exposed as a data attribute: data-theme="a"
.
Initialize the collapsibleset with the theme
option specified:
1
2
3
|
|
Get or set the theme
option, after initialization:
1
2
3
4
5
|
|
Methods
refresh()Returns: jQuery (plugin only)
If you manipulate a collapsible set via JavaScript (e.g. add new collapsible containers), you must call the refresh method on it to update the visual styling.
- This method does not accept any arguments.
Invoke the refresh method:
1
|
|
Events
create( event, ui )Type: collapsiblesetcreate
Note: The ui
object is empty but included for consistency with other events.
Initialize the collapsibleset with the create callback specified:
1
2
3
|
|
Bind an event listener to the collapsiblesetcreate event:
1
|
|
Example:
A basic example of a collapsible set.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
|