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

0 Comments

0 Comments

Submit a Comment

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

News & Updates

Join Our Newsletter