This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 1 year, 8 months ago.

Element List to Toggle Collapse on other container


  • XanaduDev
    Participant

    Posts: 19
    Member Reply #6676

    Hi,

    I’m using metronic_v4.5.6 admin_1 layout.

    Tried using Element List -> Simple Group from elements_lists.html and I wanted to know if there is a way I can toggle collapse to bottom container when I click the top container (and vice versa) ? My goal is to show only one container collapsed at any point.

    Thanks.

    Attachments:
    You must be logged in to view attached files.
    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #6691

    Hi,

    You can use below workaround:

    <script>

    $(‘document’).ready(function() {
    $(‘#accordion1 .list-toggle-container’).click(function() {
    var el = $(this);
    $(‘#accordion1’).find(‘.collapse.in’).each(function() {
    if ( ‘#’ + $(this).attr(‘id’) != el.attr(‘href’) ) {
    $(this).collapse(‘hide’);
    }
    });
    });
    });

    </script>

    accordion1” is an ID that you will need to assign parent UL element of the list.

    If you need any further clarifications please let us know.

    Thanks.

You must be logged in to reply to this topic.