Archived topic
Mobile Menu is still visible after Menu Item is clicked
9 replies · Started by David on February 23, 2017
The mobile menu is sliding away after the user clicked the Menu Item. Any recommendations? Tom, I hope you are feeling better.
Here is the URL:
http://cmcwebdev.com/pounders/
Cheers!
Hi David,
I'm assuming you want the mobile menu to close after click? If so this should help:
https://generatepress.com/forums/topic/close-menu-on-mobile-after-clicking/#post-265481
Let me know.
Yes, that is correct, Leo. Mobile menu to close after click. I set the code in the wp_footer hook. It didn't work on my end. Any recommendations?
Make sure you wrap <script></script> around it as here: https://generatepress.com/forums/topic/responsive-menu-and-anchor-links/#post-273558
Let me know.
Thanks for posting that links. Read through and discover there is another set of code for the slide out menu. I failed to write mobile slideout menu.
<script>
jQuery( document ).ready( function( $ ) {
var settings = {
animation_duration: false,
place: "left",
animation_curve: false,
body_slide: false,
no_scroll: false,
};
$( '.slideout-navigation a' ).on( 'click', function( event ) {
$('.slideout-navigation').sliiide( settings ).deactivate();
$( '.menu-toggle.opened' ).removeClass( 'opened' );
$( '.slideout-toggle.opened' ).removeClass( 'opened' );
$( 'body, html' ).removeClass( 'slide-opened' );
$( '.slideout-overlay' ).hide();
$( '.slideout-toggle' ).removeClass( 'sfHover' );
$( document ).off( 'touchmove' );
$( 'body' ).off( 'touchmove touchstart', '.slideout-navigation' );
});
});
</script>
That did it. Thanks!
Cheers!
Glad you got it working!
This seems to be something that's being requested more and more, might be worth adding by default.
I would agree to add. Several people tested the site. They all expected the menu to slide away on click.
Thanks! Coffee infusion time coming up.
I have the same problem. I use elementor 2.0.5 and elementor pro 1.15.6. My URL is https://skladpodnaem.com/.
I tried to fix the problem myself but didn't work. Please tell me how to fix problem step by step. I tried to put some code from the forum without any success.
You're using the Elementor menu, so you would have to ask them how to do it with their code.