Solvedelementor Accordion - setting for all closed at start
βοΈAccepted Answer
Yeah not seeing a fix in 1.8.x but here's some code you should be able to copy/paste without modding. The delay is there so that it executes after the accordion code:
<script>
jQuery(document).ready(function($) {
var delay = 100;
setTimeout(function() {
$('.elementor-tab-title').removeClass('elementor-active');
$('.elementor-tab-content').css('display', 'none');
}, delay);
});
</script>
Other Answers:
+1 for this feature request.
Odd it's not closed by default. Kinda defeats the purpose of an accordion.
Thanks for the code snippet ... but I don't do code/programming (have never mastered it) ... which is why I use plugins like Elementor.
Agree with enviedbymost's comment ... other Accordions I've used have been closed to start with.
Please use the Toggle widget instead of the Accordion, Itβs a similar widget but all items closed by default
Source https://wordpress.org/support/topic/close-first-accordion-item/
I have found a workarround:
Add a HTML code element to the page and paste this code:
It will close the first element after loading the page. It's ugly but it works.
source: https://voidcoders.com/elementor-accordion-closed-by-default/
Description
When Accordion is first displayed at page load, the first element is always open - would like a setting so all can be closed when page loads.
arielk commented (and closed the issue) "For this option please use Toggle widget instead of Accordion"
Unfortunately, Toggle doesn't work the same as Accordion ... elements have to be closed manually. In Accordion, there is only ever one open at a time - which is the behavior I want - so Toggle isn't a substitute.
Where there is a longish list (e.g. and FAQ), it's better for the visitor to see all the list headings before chosing ... it doesn't make sense to have the first item open, as it probably isn't appropriate to the visitor.
Steps to reproduce
Environment