Tagged: Accordion
-
AuthorPosts
-
November 20, 2018 at 9:12 pm #1035794
Hi,
We have created on this page 6 accordions in a single color section : https://kiffetonchantier.com/home/
Each accordion is in a single column on the back office of Enfold (Avia formatting tool).When we open an accordion on the front office of this page, we would like that others close automatically.
Indeed, it’s not the case wheras we have checked “Only one panel can be open at a time (accordion)” for each accordion on Avia formatting tool.
Can you please explain us how to fix it ?
Thanks a lot for your answer,
Best Regards,
A&M Concept Team from France
November 22, 2018 at 4:55 pm #1036607Hey AMconcept,
You can only have that functionality in an accordion if it’s in one accordion but if it’s separate, it won’t work since it doesn’t check for other accordions outside.
Though what you want to achieve is still possible using some javascript/jquery code. Can you give us temporary admin access? so we can try to add this then post what we have changed.
Just post the credentials in private content so it’s only visible to the moderators.Best regards,
NikkoNovember 23, 2018 at 3:21 pm #1036972Hi Nikko,
Thanks a lot for your answer ! You’ll find our credentials in private content, many thanks in advance for your help !
Best regards,
A&M Concept Team from France
November 27, 2018 at 3:57 pm #1038044Hi,
Thanks for giving us both admin and ftp access.
I have added this in the Developer ID of your section (wrapping the toggle) accordion-section
Then in your functions.php, I have added this php code (at the bottom):function accordion_fn(){ ?> <script> $( document ).ready(function() { $( "#accordion-section .single_toggle .toggler" ).on("click", function() { var $el = $( "#accordion-section" ), fake_id = $(this).data("fake-id") + "-container", $id = $( fake_id ).attr('id'); $el.find(".toggle_wrap").each(function(){ var temp_id = "#" + $(this).attr('id'); if( !( temp_id == fake_id ) ) { $(this).removeClass("active_tc"); } }); }); }); </script> <?php } add_action('wp_footer', 'accordion_fn');
However during theme update this tweak would be lost so I would suggest using a child theme: https://kriesi.at/documentation/enfold/how-to-install-enfold-theme/#why-child-theme
Then remove the code I added in the functions.php of the parent theme and put it in the functions.php of your child theme.
Hope this helps.Best regards,
NikkoNovember 28, 2018 at 7:20 pm #1038674Hi Nikko,
Thanks a lot for your help, that’s perfect !
Have a nice continuation,
Best regards,
A&M Concept Team from France
November 28, 2018 at 7:39 pm #1038686Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Automatically close accordions on a single color section’ is closed to new replies.