Menu

Collapse

Patrick Garske

collapsible_div(content, id, show)


Creates a collapsible div

content - Content inside the collapsible container

id - Div id (Important - an id cannot be assigned to multiple elements at once)

show - If true, the collapsible div will be shown when the page is loaded

collapse_link(id)


Creates a link which can be used with custom_link(..) to toggle the collapsible div

id - The ID of the collapsible div

Example

View Working Example

echo collapsible_div("Content 1", "collapse1", "true");
echo custom_link("outline-button", collapse_link("collapse1"), "Hide/Show Content1", "primary", no_arg());
echo custom_link("outline-button", collapse_link("collapse2"), "Hide/Show Content2", "secondary", no_arg());
echo collapsible_div("Content 2", "collapse2", no_arg());

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.