[Resolved] Mobile menu below Logo

Home Forums Support [Resolved] Mobile menu below Logo

Home Forums Support Mobile menu below Logo

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #93093
    Roberto Enrique

    Is it possible to move the mobile menu below the logo?

    #93231
    Tom
    Lead Developer
    Lead Developer

    Where do you currently have it placed? I can provide some javascript that will move it on mobile once I know πŸ™‚

    Thanks!

    #93241
    Roberto Enrique

    Right now is placed at the right side of the logo:

    Right Menu

    #93441
    Roberto Enrique

    I really need to put that menu bellow logo. Can you put me in the right direction, I’m not that proficient with coding.
    If it is not possible just let me know.

    Thanks in advance

    #93453
    Tom
    Lead Developer
    Lead Developer

    Adding this code to the wp_footer hook should do the trick:

    <script type="text/javascript">
    	jQuery(window).load(function($) {
    		var mobile, widthTimer;
    		mobile = jQuery( '.menu-toggle' );
    			
    		function generateCheckWidth() {
    			if ( mobile.is( ':visible' ) ) {
    				jQuery('.main-navigation').appendTo('.inside-header');
    			} else {
    				jQuery('.main-navigation').prependTo('.inside-header');
    			}
    		}
    			
    		if ( mobile.is( ':visible' ) ) {
    			generateCheckWidth();
    		}
    			
    		jQuery(window).resize(function() {
    			clearTimeout(widthTimer);
    			widthTimer = setTimeout(generateCheckWidth, 100);
    		});
    	});
    </script>

    Let me know if that works or not πŸ™‚

    #93481
    Roberto Enrique

    It works Tom, the style changes a little bit, the menu is now full with but I think I can handle that with some simple css.

    Before:

    After:

    Thank you very much.

    #93482
    Tom
    Lead Developer
    Lead Developer

    Interesting – if you want to send me a URL via email feel free – I may be able to see why it’s gone to full width.

    #93550
    Tom
    Lead Developer
    Lead Developer

    I edited my code above – it should work now πŸ™‚

    #93570
    Roberto Enrique

    That was just perfect!
    Thanks Tom.

    #93780
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #134036
    Richard Bland

    Sweet!

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.