Created
June 6, 2020 12:02
-
-
Save wplit/b368f7d12392aa0b52ca9f5df9c02069 to your computer and use it in GitHub Desktop.
make sure offcanvas closes when menu item clicked if hashlink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('.oxy-off-canvas .menu-item a[href*=\\#]').on('click', function (event) { | |
if(this.pathname === window.location.pathname){ | |
jQuery('body').removeClass('off-canvas-toggled'); | |
jQuery('.oxy-off-canvas').removeClass('oxy-off-canvas-toggled'); | |
jQuery(jQuery('.offcanvas-inner').data('trigger-selector')).find('.hamburger').removeClass('is-active'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment