Website Building » Elementor » How do I make my accordion close by default Elementor?

How do I make my accordion close by default Elementor?

Last updated on January 29, 2023 @ 7:59 pm

Accordion is a versatile and popular element in web design. It can be used to convey a message or to highlight a section of a page.

However, there may be times when you want the accordion to be visible by default. Elementor allows you to do just that.

To make the accordion open by default in Elementor, follow these steps:

1. Open the “Elementor editor“.

Open the Elementor Editor WordPress

2. In the left column, search for the “HTML widget“.

Search the HTML Widget on Elementor WordPress

3. Drag and Drop the “HTML widget” on your project window.

Drag and Drop the HTML Widget on your project window Elementor WordPress

4. To make changes, “enter the following script in the HTML text box field” and choose “Update.”

<script>
jQuery(document).ready(function($) {
var wait = 50; setTimeout(function() {
$('.elementor-tab-title').removeClass('elementor-active');
 $('.elementor-tab-content').css('display', 'none'); }, wait);
});
</script>

Type the code to the HTML text box field and Click Update Elementor WordPress

Your accordion will now open by default in Elementor.

Conclusion

In conclusion, Elementor provides a simple way to make an accordion visible by default. This can be achieved by using the HTML widget and using the appropriate script.

The process involves opening the Elementor editor, finding the HTML widget, dragging and dropping it into the project window, and pasting the script into the HTML text box field. After following these steps, the accordion will be now open by default.

PRO TIP: If you are using Elementor to create an accordion, be aware that there is no setting to make the accordion close by default. This means that if you have multiple accordions on a page, they will all be open by default. This can cause confusion for your users, so make sure to test your accordions thoroughly before publishing your page.
Kathy McFarland

Kathy McFarland

Devops woman in trade, tech explorer and problem navigator.