In DIVI, by default the first toggle of an accordion module starts open, but sometimes we could like to have a clean list of headlines and only at further interest it should be possible to open the entries. The toggle module is doing that, but if we want to use an accordion, meaning that only one item can be open at a time, we can start the accordion all closed with this code in the head section (Theme Options / Integration / Activate “Enable header code” and enter into “Add code to the < head > of your blog”):
1 2 3 4 5 6 7 8 9 10 11 |
<script> jQuery(function($){ $('.et_pb_accordion .et_pb_toggle_open').addClass('et_pb_toggle_close').removeClass('et_pb_toggle_open'); $('.et_pb_accordion .et_pb_toggle').click(function() { $this = $(this); setTimeout(function(){ $this.closest('.et_pb_accordion').removeClass('et_pb_accordion_toggling'); },700); }); }); </script> |
well. another way is to ‘hide’ the first toggle. You can do that with CSS of that element (hidden)
Thanks for sharing Maarten, meanwhile I also found that trick.