Skip to main content

JS support to expand/collapse content, like HTML5 details/summary elements

Project description

django-html5accordion adds JS support to expand/collapse any content, like HTML5 details/summary elements. It can be called on any element, and takes as an argument a selector for the summary contents that should always remain visible (and act as the link to expand/collapse the hidden content).

Dependencies

Installation

In your Django project settings, add “html5accordion” to your INSTALLED_APPS.

Usage

Linking the JS:

<script src="{{ STATIC_URL }}html5accordion/jquery.html5accordion.js"></script>

Sample HTML:

<article class="details">
  <header class="summary">
    <p>This content will always be visible</p>
  </header>
  <div>
    <p>This content will expand/collapse when `.summary` is clicked</p>
  </div>
</article>

Calling the plugin:

$('.details').html5accordion('.summary');

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-html5accordion-0.1.3.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file django-html5accordion-0.1.3.tar.gz.

File metadata

File hashes

Hashes for django-html5accordion-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6e4ad25daed9cb26b17ae265f0f53eef93da85bc3263de5c344872cd20e16f0a
MD5 ce08e15efa6a1ed236466b1ac061256f
BLAKE2b-256 d2dadd8d0ca143c467d6210e3bc7eb7eea81231d7882ea8fd5cea34b92b54e4a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page