May 21, 2021 jQuery Mobile
Collapsible blocks allow you to hide or display content - useful for storing some information.
To create a collapsible block of content, you need to add the data-role"collapsible" property to the container. Within the container (div), add a title element (H1-H6), followed by the HTML tag you want to extend:
By default, content is collapsed. To expand the content when the page loads, use data-collapsed "false":
Collapsible blocks of content can be nested with each other:
Collapsible blocks of content can be nested multiple times according to your needs. |
A collapsible collection is a combination of collapsible blocks (like an accordion). When a new block is expanded, all other blocks are folded up.
Create several collapsible blocks of content, and then surround the collapsible blocks with a new container with data-role"collapsible-set":
The fillet is canceled by the data-inset property
How to cancel fillets on a collapsible block.
Miniaturize collapsible blocks with data-mini properties
How to make the collapsible block smaller.
Change the icons with data-collapsed-icon and data-expanded-icon
How to change the icon of the collapsible block (the default is . . . and -).
You can learn more about jQuery Mobile collapsible blocks by practicing the examples above!