How to make an Elementor Toggle or Accordion closed by default

How to Close the Elementor Toggle and Accordion By Default

Elementor comes with an awesome Toggle and Accordion widget that allows you to create titles that expand and show content.

What can be annoying is that they’re always open by default.

If you’re looking to close the Elementor Toggle or Accordion by default, this will help you out:

Add Some Custom Code

Use an HTML block in Elementor, and place it right before the Toggle or Accordion you want to open by default.

Insert this 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>

That’s it!

Now your Toggle or Accordion is closed by default.

Use This for Multiple Elementor Toggles or Accordions

You can also make this global.

Head to the WordPress dashboard to the side menu.

Go to Elementor > Custom Code.

Insert the code above and insert it in the <head> of the site.

Now all of your Toggles and Accordions are closed by default!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *