Is there any way to make Accordeon open on desktop and closed on mobile? Maybe some advanced css settings or any hack?
you can create 2 version of accordion that is for desktop and mobile.
Hi @Audrius,
We don’t currently offer a way to have the accordions open/close depending on the screen size.
This was previously requested by @Jonas here.
Feel free to add your vote and thoughts to that thread.
Nice idea, @kris!
It’s the same as going back 10 years and creating a site for desktop, then for mobile, for tablet etc… One content and a lot of locations to manage it. It’s a solution, but I’d like to avoid it.
well there is a way using javascript.
check the id or class of the accordion item you want to open by default.
and on script file just add
if (window.innerWidth < 700) {
accItem.classList.add('cc-accordion-active');
accItem.classList.remove('cc-accordion-hidden')
}
where accItem is the actual accordion item you want to open
the method is in reverse. so you can just put like >700 then remove hidden class and add active so it will open on larger screen than 700
Nice, thank you.