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 Accoirdion elements already open or closed when the page loads. Unfortunately, it does not work in the preferences of the element. However, with a few lines of Javascript in the theme code or a WP plug-in for custom Javascript, you can make do.
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 );