May 22, 2023

How to Close Elementor Accordion Widget by Default

Play Video

What is the tutorial about?

Learn how to close Elementor Accordion widget by default. This is a common issue faced by many WordPress users, and this tutorial by PluginsForWP provides a simple and effective solution. The tutorial covers how to close a single accordion, all accordions, or specific ones using the Accordion, HTML widgets, and custom JavaScript codes. It even includes a bonus section on troubleshooting and solving the problem if the Elementor accordion remains open after using the JavaScript code.

Use Cases for this Tutorial

  • Website Designers:
    This tutorial is a valuable resource for website designers who want to enhance the user experience on their sites by managing the default state of the Elementor Accordion widget.
  • WordPress Developers:
    Developers can use this tutorial to understand how to manipulate widgets using JavaScript, a skill that can be applied in many other scenarios.
  • Bloggers and Content Creators:
    For those who manage their own WordPress sites, this tutorial can help them control the presentation of their content for better readability and user engagement.
  • Business Owners:
    Business owners who use WordPress for their company websites can use this tutorial to improve the layout and user experience of their sites.

Required Code

Source: https://pluginsforwp.com/blog/elementor-accordion-widget-closed-default/

Default Close a Single Accordion

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

Close All Elementor Accordions by Default

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

Default Close Specific Accordions

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

Required Resources

Elementor Logo
Free Options
Credit to PluginsForWP
PluginsForWP is a resourceful channel dedicated to providing tutorials and guides about WordPress plugins and themes. The channel covers a wide range of topics related to WordPress, including how to fix common issues, add new features, and optimize your website for better performance.
Visit
How to Close Elementor Accordion Widget by Default
Welcome back!
Enter your Helwp credentials to sign in.

No Account yet? Sign Up

My Account
Menu
Give Feedback
Describe your feedback *
Rate Helwp
Share
Facebook
Twitter
LinkedIn
Reddit
Email
WhatsApp
Telegram
Pocket
Report
Problem *
Describe the problem
Want us to reply?
Your E-Mail
Affiliate Disclosure

At Helwp, we’re committed to transparency and honesty. Therefore, we want to inform you that some of the links on our website are affiliate links. This means that, at no additional cost to you, we may earn a small commission if you click through and make a purchase.

We only promote products or services that we genuinely believe in. These affiliate commissions help us to maintain the website and continue to provide you with free, high-quality WordPress content.

If you are interested in how you can support us even further, check out our support page.