Created
January 30, 2026 11:40
-
-
Save hmowais/8d28c8d0c59847234c7aa0ae2e089583 to your computer and use it in GitHub Desktop.
Close Canvas on menu click in Elementor
This file contains hidden or 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(document).ready(function($) { | |
| // Offcanvas container | |
| var $offcanvas = $("#off-canvas-6f5ddbf"); | |
| // Menu links inside offcanvas | |
| $(".elementor-nav-menu li a").on("click", function() { | |
| // Remove active class | |
| $offcanvas.removeClass("e-off-canvas--active"); | |
| // Set aria-hidden true for accessibility | |
| $offcanvas.attr("aria-hidden", "true"); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment