Advertisement
Udoro

Collapse the Pro Menu on clicking menu item

Feb 9th, 2021 (edited)
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function($) {
  2.     $("body").on("click", ".oxy-pro-menu-list > li > a", function(e) {
  3.       let currentPathname = window.location.href.split("://").pop();
  4.       let urlClickedOn = this.href.split("://").pop();
  5.  
  6.      
  7.         $(this).parents('.oxy-pro-menu').removeClass('oxy-pro-menu-open');
  8.         $(this).parents('.oxy-pro-menu-container').removeClass('oxy-pro-menu-open-container');
  9.         $('.oxy-nav-menu-prevent-overflow').removeClass('oxy-nav-menu-prevent-overflow');
  10.  
  11.         if ($(this).parents('.oxy-pro-menu-container').hasClass('oxy-pro-menu-off-canvas-container')) {
  12.           oxygen_offcanvas_menu_run($(this).parents('.oxy-pro-menu'));
  13.        
  14.      
  15.   }
  16.      
  17.        
  18.      
  19.     });
  20.  
  21.  
  22.   });
  23.  
  24.  
  25.  
  26.  
  27. /*
  28. untested:
  29.  
  30.  
  31. jQuery(window).on("load",function(){
  32. jQuery(document).on("click",".menu-item a",function(){
  33. jQuery(".oxy-pro-menu-mobile-close-icon").trigger("click");
  34. });
  35. });
  36.  
  37.  
  38.  
  39.  
  40. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement