When you using the Divi accordion module – the first items is set to be open by default, and there is no option to set it to be closed. If you would like all your accordion items to be „closed“ by default, there is a simple trick that makes the 1st (open) item of your accordion invisible.
This method will work without using any jQuery or extra coding as it merely adds an additional accordion item to the top of your accordion and hides it using some custom CSS added within the module itself. The result is that the rest of your accordion items below this hidden (open) one will all now have the appearance of being closed as default.
step by step tutorial
- Add your Divi accordion module and add your items within it as normal.
- Click on Add New Accordion Item and drag it to the top of the accordion
- then within that new item, go into the Custom CSS tab and in the Main Element box add the following code
1
display:none;
- Save and preview and you will now see that all of your (visible) accordion items are closed by default.
0 Kommentare