Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1141062
    johnmilnes
    Participant

    Hi there, I’m using the Icon theme and want to know how to keep the Acordion answer fields closed ”when one opens the last one closes”. I remember there was a video tutorial about this somewhere but I can no longer find it.

    Best Regards, John

    #1141079
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! By default, when you insert an accordion element, the first item will display as open. You can override this setup by making sure that the first item is closed. Please check out this screenshot:

    As soon as this is setup, the accordion elements will open and close independently. If you want them to open an item and close the other item when it is open, you must enable the “Linked Items” option as seen here:

    Hope this helps.

    #1141958
    johnmilnes
    Participant

    Thanks for getting back. Unfortunately this page was written before Cornerstone so I still have the old editor. Therefore not displaying in Cornerstone. If I remember there may be some text I can put in the parent ID to close previous accordion item.
    Screen shot below:

    #1142170
    Nabeel A
    Moderator

    Hi again,

    Please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery(document).ready(function($){
    	$('.x-accordion-heading').click(function(){
                    $('.x-accordion-heading').next().toggle();
    		$('.accordion-body.collapse').hide();
    		$(this).next().toggle();
    	});
    });

    Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #1142689
    johnmilnes
    Participant

    Thanks again for getting back again. When I apply those settings, if the first heading is clicked, the next two headings open. As in screen shot below. Regards, John

    #1142884
    Christian
    Moderator

    Hey John,

    Sorry for the confusion. You don’t need that Javascript code given in the previous reply. The Link Items option is not available in Visual Composer but you can group accordion items out of the box so that only one accordion item opens at a time. To do that, add an ID to your Accordion Settings (see attachment). Then, use that ID as the Parent ID of your accordion items (see attachment). The Parent ID was replaced by the Link Items option in Cornerstone.

    For more details, please see http://demo.theme.co/integrity-1/shortcodes/accordion/

    Hope that helps. 🙂

    #1143000
    johnmilnes
    Participant

    Thanks Nabeel, that works perfectly. I’m very happy now 🙂

    Have a great day!

    #1143244
    Rahul
    Moderator

    Glad we could help you.

    If you still have any queries, let us know. We’d be happy to assist you with everything.

    Thanks for using the X theme.

  • <script> jQuery(function($){ $("#no-reply-1141062 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>