Advertisement
fauzanjeg

JKIT || Close Menu Canvas when menu on click

Oct 29th, 2023
1,420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. /**
  2.  * Close Menu Canvas when menu on click
  3.  */
  4. function jkit_close_menu_canvas_when_menu_on_click() {
  5.     ?>
  6.     <script>
  7.         /**
  8.          * Close Menu Canvas when menu on click
  9.          */
  10.         (function ($) {
  11.             $(document).on('ready', function () {
  12.                 const wrapper = $('.jeg-elementor-kit.jkit-nav-menu');
  13.                 const menuWrapper = wrapper.find('.jkit-menu-wrapper');
  14.                 const menu = menuWrapper.find('.jkit-menu-container .menu-item')
  15.  
  16.                 menu.on('click', function () {
  17.                     menuWrapper.removeClass('active');
  18.                 });
  19.             });
  20.         })(jQuery);
  21.     </script>
  22.     <?php
  23. }
  24. add_action( 'wp_head', 'jkit_close_menu_canvas_when_menu_on_click' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement