Please note :1. data-toggle="collapse" is required on the anchor element to show and hide the <div> element that has the id as imageGallery

2. collapse class on the <div> element that has the id as imageGallery, keeps the Image Gallery hidden when the page initially loads. To keep the Image Gallery expanded on the initial load, use collapse and in classes.

<divclass="panel-body collapse in"id="imageGallery">

3. Button element can also be used as the trigger element, instead of an anchor element

In the example above we have used data attributes to expand and collapse Image gallery. We can also manually do this using the collapse() function provided by the collapse plugin. The following are the values that can be passed to the collapse function

<tablestyle="border-collapse:collapse"border="1">

<tbody>

<tr>

<tdstyle="padding:3px">collapse(toggle)</td>

<tdstyle="padding:3px">Toggles a collapsible element</td>

</tr>

<tr>

<tdstyle="padding:3px">collapse(show)</td>

<tdstyle="padding:3px">Shows a collapsible element</td>

</tr>

<tr>

<tdstyle="padding:3px">collapse(hide)</td>

<tdstyle="padding:3px">Hides a collapsible element</td>

</tr>

</tbody>

</table>

The following example demonstrates expanding and collapsing the Image Gallery manually using the collapse() function