W3 Mind Logo
Home » How to keep Accordion closed by default in Elementor

How to keep Accordion closed by default in Elementor

How to keep Accordion closed by default in Elementor

There is very simple way to make this happen. You just need to take a deep breath that’s it. Just kidding 🙂

Actually it’s as easy as taking a deep breath. So let’s get to the point.

First and last, you just need to copy the below JavaScript code and past it just above the accordion you created.

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

Now tell me is it not as easy as I told above? Anyway, after entering the above JavaScript you will see that all accordions will be closed by default.

I will recommend to add this JavaScript code on those specific pages where you want this feature instead of all the pages where it is not needed and if this feature is available on all your pages then you can add it somewhere in the </head> or before closing </body> tags globally.

Example:
About Author
W3Mind

W3Mind

W3Mind focuses on Blogging, Make Money Online, SEO, Business Blogging, Social Media, WordPress, Internet Tools, Web Design and Development.
Give it a Share
Facebook
Twitter
LinkedIn
You May Also Like
Leave a Reply

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

How to
START A
BLOG
(step by step)
Load WordPress Sites in as fast as 37ms!