Close Default Open Accordion in Divi

June 28, 2020

Comments

 

In accordion module, first accordion is set to be open by default on opening the page. But we can close default open accordion by applying some javascript.

To close the default accordion toggle,

Go to Divi > Theme Option > Integration

And copy the given code in the text field given below “Add code to the < head > of your blog”

 

!--colapse divi Accordian-- - >
<
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>

 

This will close default open accordion.

Related Posts

How to Keep Divi Columns in Mobile View Using CSS

How to Keep Divi Columns in Mobile View Using CSS

See DemoKeep Divi Column ratios and build aesthetically beautiful mobile layouts for the Divi Builder. Regular Section TutorialAfter activating the CSS plugin, the next thing you do is select the row that you want and type or copy the related CSS class name in the...

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

News & Updates

Join Our Newsletter

[caldera_form id=”CF59c8d8a75c5cd”]