Skip to content

Instantly share code, notes, and snippets.

@elicus
Last active October 14, 2021 12:32
Show Gist options
  • Save elicus/b078f8ca931340f45cd15f99a72440d1 to your computer and use it in GitHub Desktop.
Save elicus/b078f8ca931340f45cd15f99a72440d1 to your computer and use it in GitHub Desktop.
How To Build Divi Hamburger Menu on Desktop
<script>
(function($){
$('body').on('click', '.de-menu-ham-icon', function(){
$(".de-menu-row").toggleClass("de-menu-active");
});
$('body').on('click', '.de-menu-close-icon', function(){
$(".de-menu-row").toggleClass("de-menu-active");
});
$('body').on('click touchstart', '.et-menu .menu-item-has-children > a', function() {
$(this).attr('href', '#/');
$(this).parent().children().children().toggleClass('de-show-menu-items');
$(this).toggleClass('de-menu-switched-icon');
});
jQuery(window).load(function(){
jQuery('.de-menu a[href*="#"]:not([href="#"])').on('click', function(){
jQuery(".de-menu-row").toggleClass("de-menu-active");
});
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment