brooklyndesignstudio

Divi Accordion Module Fixes

Jun 30th, 2019
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!-- [ Accordion Start In Close Position ] -->
  2. <script>
  3. jQuery(function($){
  4.     $('.et_pb_accordion .et_pb_toggle_open').addClass('et_pb_toggle_close').removeClass('et_pb_toggle_open');
  5.  
  6.     $('.et_pb_accordion .et_pb_toggle').click(function() {
  7.       $this = $(this);
  8.       setTimeout(function(){
  9.          $this.closest('.et_pb_accordion').removeClass('et_pb_accordion_toggling');
  10.       },700);
  11.     });
  12. });
  13. </script>
  14.  
  15. <!-- [ Accordion Open - Close ] -->
  16. <script>
  17. jQuery(function($){
  18.   $('.et_pb_toggle_title').click(function(){
  19.     var $toggle = $(this).closest('.et_pb_toggle');
  20.     if (!$toggle.hasClass('et_pb_accordion_toggling')) {
  21.       var $accordion = $toggle.closest('.et_pb_accordion');
  22.       if ($toggle.hasClass('et_pb_toggle_open')) {
  23.         $accordion.addClass('et_pb_accordion_toggling');
  24.         $toggle.find('.et_pb_toggle_content').slideToggle(700, function() {
  25.           $toggle.removeClass('et_pb_toggle_open').addClass('et_pb_toggle_close');
  26.                    
  27.         });
  28.       }
  29.       setTimeout(function(){
  30.         $accordion.removeClass('et_pb_accordion_toggling');
  31.       }, 750);
  32.     }
  33.   });
  34. });
  35. </script>
RAW Paste Data