Skip to main content

jQuery html5accordion plugin package for Django

django-html5accordion adds JS support to expand/collapse any content, like HTML5 details/summary elements. It can be called on any element, and accepts options to set the selector for the summary contents that should always remain visible (and act as the link to expand/collapse the hidden content), the speed of the slideUp/Down animation, the class to be added when the details element is expanded, selectors for elements within summary that should not trigger the expand/collapse, and callback fns.

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();

Calling the plugin with a variety of options explicitly configured to their default values:

$('.details').html5accordion({
  summarySelector: '.summary',                // Selector for summary text
  slideSpeed: 200,                            // Slide animation speed (ms)
  expandedClass: 'open',                      // Class added when details are
                                                // expanded
  ignoredElements: 'button, a, input, label', // Elements within `summary` that
                                                // will not trigger expand/collapse
  initialSlideSpeed: null,                    // Slide animation speed (ms) for
                                                // already-expanded details
  openCallback: null,                         // Callback fn after open animation
  closeCallback: null                         // Callback fn after close animation
});

Note: To expand a details element on initial load, simply add class open (or whatever class is passed as option expandedClass), or add attribute open.

Metadata

Release files for django-html5accordion 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-html5accordion 0.1.8
File Size Uploaded Provenance Actions
django-html5accordion-0.1.8.tar.gz 5.7 kB Without provenance Details for django-html5accordion-0.1.8.tar.gz

Release files / django-html5accordion-0.1.8.tar.gz

Download URL django-html5accordion-0.1.8.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
55f93d01a8da99f3748451cb6177c4c5bd06ce28b107f03f7a8f146ff81fe210
BLAKE2b-256 checksum
How to use checksums
9e5e4a92df85bb3b88f601b04bea7dec4a032891ec27fa1282c4c32278cfb8ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-html5accordion 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page