{"id":14806,"date":"2019-03-20T08:07:11","date_gmt":"2019-03-20T08:07:11","guid":{"rendered":"http:\/\/rnbtheme.com\/documentation\/?p=14806"},"modified":"2022-02-22T12:12:34","modified_gmt":"2022-02-22T12:12:34","slug":"close-menu-by-click-on-menu-item-header-style-7","status":"publish","type":"post","link":"https:\/\/rnbtheme.com\/documentation\/knowledge-base\/close-menu-by-click-on-menu-item-header-style-7","title":{"rendered":"Close menu by click on menu item (header style 7)"},"content":{"rendered":"<p>Header style 7 menu is not supposed to be close by click on menu item so when you are using anchor menu it&#8217;s not always convenient for the users to navigate the site.<\/p>\n<p>Following JS code will help you, it will close the menu as soon as user click on menu item:<\/p>\n<pre>&lt;script type=\"text\/javascript\"&gt;\r\n(function($) {\r\n$(window).load(function(){\r\n$('.header-style-7 .mega-menu-item:not(.has-submenu)').find('.menu-link').on('click touchend', function() {\r\n$('#header-container').removeClass('opened');\r\n});\r\n});\r\n})(jQuery);\r\n&lt;\/script&gt; \r\n<\/pre>\n<p>Add the code to <del class=\"support-arrow-right\">Theme options<\/del>\u00a0<del class=\"support-arrow-right\">General options<\/del>\u00a0<del class=\"support-arrow-right\">Custom CSS\/JS<\/del> <del>Custom JS<\/del> field.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Header style 7 menu is not supposed to be close by click on menu item so when you are using anchor menu it&#8217;s not always convenient for the users to<\/p>\n","protected":false},"author":30,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[138,216,74,14,139,137],"_links":{"self":[{"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/posts\/14806"}],"collection":[{"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/comments?post=14806"}],"version-history":[{"count":9,"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/posts\/14806\/revisions"}],"predecessor-version":[{"id":15532,"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/posts\/14806\/revisions\/15532"}],"wp:attachment":[{"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/media?parent=14806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/categories?post=14806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rnbtheme.com\/documentation\/wp-json\/wp\/v2\/tags?post=14806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}