Tagged: x
-
AuthorPosts
-
November 25, 2016 at 5:03 am #1270388
waterbarryParticipantI’ve a one page site.
I want the menu fixed at the top on mobile.
The problem is that the menu doesn’t collapse when an item is clicked. So it covers the page.
How can I get the menu to collapse when an item is clicked?
November 25, 2016 at 5:10 am #1270396
Paul RModeratorHi,
You can add this under Custom > Javascript in the Customizer.
jQuery(function($) { $( ".x-navbar .mobile .x-nav li a" ).on( "click", function() { $('.x-btn-navbar').click(); }); });Hope that helps.
November 27, 2016 at 6:38 am #1272083
waterbarryParticipantThat doesn’t seem to work for mobile. It looks like it’s a tap not a click.
November 27, 2016 at 7:22 am #1272098
ThaiModeratorHi There,
Please try with this code instead:
(function($){ $('.x-navbar .x-nav-wrap.mobile a').on('click touchend', function(){ $('.x-nav-wrap.mobile').toggleClass('in').css('height', 0); $('.x-btn-navbar').toggleClass('collapsed'); }); })(jQuery);Hope it helps 🙂
November 27, 2016 at 8:25 am #1272117
waterbarryParticipantThat’s perfect. Thanks
November 27, 2016 at 8:44 am #1272122
ThaiModeratorYou’re most welcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1270388 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
