Skip to content

Instantly share code, notes, and snippets.

@phirebase
Forked from elicus/Divi Foldable Menu JQuery
Created December 2, 2022 15:06
Show Gist options
  • Save phirebase/d59e868507b48e42dde2d7ddf858a019 to your computer and use it in GitHub Desktop.
Save phirebase/d59e868507b48e42dde2d7ddf858a019 to your computer and use it in GitHub Desktop.
<script>
(function($) {
function collapse_menu() {
var ParentMenuItem = $('.et_mobile_menu .parent-menu-item > a');
ParentMenuItem.off('click').click(function() {
$(this).attr('href', '#');
$(this).parent().children().children().toggleClass('show-menu-items');
$(this).toggleClass('switched-icon');
});
}
$(window).load(function() {
setTimeout(function() {
collapse_menu();
}, 700);
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment