Elementor/Ultimate-Accordion always open/closed?
By default, when a web page loads, the first element of such an Accordion element is always open, the others closed. The user can later switch all elements normally. It’s all about the default setting when loading the page.
There are design decisions or good SEO reasons to have all accordion elements already open or closed when loading the page. Unfortunately, it does not work in the preferences of the element. With a few lines of Javascript in the theme code or a WP plug-in (e.g. B. custom-css-js) for individual Javascript can be used to good effect.
There are many similar tips on the web for the Elementor accordion, but we couldn’t find any for the Ultimate for Elementor accordion.
Here is the code:
Elementor & Ultimate add-on
Accordion always on
(function($) {
//-- (WRAPPER for jQuery)
$(document).ready(function (){
setTimeout(function() {
// Elementor Accordion immer AUF:
$('.elementor-tab-title').addClass('elementor-active');
$('.elementor-tab-content').css('display', 'block');
// ULTIMATE Accordion immer AUF:
$('.uael-accordion-title').addClass('uael-title-active');
$('.uael-accordion-content').css('display', 'block');
}, 100);
});
//-- (/WRAPPER)
})( jQuery );
Elementor & Ultimate add-on
Accordion always closed
(function($) {
//-- (WRAPPER for jQuery)
$(document).ready(function (){
setTimeout(function() {
// Elementor "Umschalter" Accordion immer ZU:
$('.elementor-tab-title').removeClass('elementor-active');
$('.elementor-tab-content').css('display', 'none');
// ULTIMATE Accordion immer ZU:
$('.uael-accordion-title').removeClass('uael-title-active');
$('.uael-accordion-content').css('display', 'none');
}, 100);
});
//-- (/WRAPPER)
})( jQuery );