diff --git a/demos/_css/extras.css b/demos/_css/extras.css index 5c0d698cd..691893801 100644 --- a/demos/_css/extras.css +++ b/demos/_css/extras.css @@ -59,3 +59,32 @@ pre { outline: 0; background-color: #eee9e6; } + + +/* Collapsible section example */ + /* Style the button that is used to open and close the collapsible content */ + .collapsible { + background-color: #eee; + color: #444; + cursor: pointer; + padding: 18px; + width: 100%; + border: none; + text-align: left; + outline: none; + font-size: inherit; + } + + /* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */ + .active, .collapsible:hover { + background-color: #ccc; + } + + /* Style the collapsible content. Note: hidden by default */ + .collapsiblecontent { + padding: 0 18px; + display: none; + overflow: hidden; + background-color: #f1f1f1; + } +/* End collapsible section example */ \ No newline at end of file diff --git a/demos/_layout/page_foot.html b/demos/_layout/page_foot.html index 6436b3a47..6b0e537a7 100644 --- a/demos/_layout/page_foot.html +++ b/demos/_layout/page_foot.html @@ -3,3 +3,22 @@ © {{ fill author }}. {{isnotpage /tag/*}}Last modified: {{ fill fd_mtime }}.{{end}} Website built with Franklin.jl. + + + + \ No newline at end of file diff --git a/demos/index.md b/demos/index.md index 6f7f9434a..0bf2012dc 100644 --- a/demos/index.md +++ b/demos/index.md @@ -20,6 +20,83 @@ The ordering is reverse chronological but just use the table of contents to guid \toc +## (018) collapsible block +How to make a section expand when clicked, so that content is initially hidden? (Based on [this html guide](https://www.w3schools.com/howto/howto_js_collapsible.asp).) + +\newcommand{\collaps}[2]{ +~~~