Support Forum

For all questions related to themes and plugins!

Enter search keyword e.g. "footer color".

  • Registration is Required

    Registration is required to post questions to support forum. ThemeForest buyers also need to obtain Purchase code to be able to post on forum.

    Please read here how to obtain Purchase code.

Private: Home Forums HTML Templates Elvyre Retina Ready HTML5 Template Accordions do not work: they do not contract Reply To: Accordions do not work: they do not contract

#1074
Robert Kavgić
Participant

Hello,

This is the normal behavior of the accordion element – one is always open and can’t be closed unless the other item is selected.

If you want to open and close each element regardless on others, go to js/include.js and find the code:

/* ================ ACCORDION ================ */

    (function() {
        'use strict';
        $('.accordion').on('click', '.title', function(event) {
            event.preventDefault();
            $(this).siblings('.accordion .active').next().slideUp('normal');
            $(this).siblings('.accordion .title').removeClass("active");

            if ($(this).next().is(':hidden') === true) {
                $(this).next().slideDown('normal');
                $(this).addClass("active");
            }
        });
        $('.accordion .content').hide();
        $('.accordion .active').next().slideDown('normal');
    })();

change it to:

/* ================ ACCORDION ================ */

    (function() {
        'use strict';
        $('.accordion').on('click', '.title', function(event) {
            event.preventDefault();
            $(this).next().slideToggle("normal");
        });
        $('.accordion .content').hide();
    })();

Every element can now be opened and closed.

Robert