- This topic has 7 replies, 3 voices, and was last updated 7 years, 3 months ago by Tom.
-
AuthorPosts
-
May 20, 2015 at 12:26 pm #109203Jack Heape
I searched the support forum but could not find an answer on this specific topic. Is there a way to move the menu button to display just above the footer section on the mobile site? Or just not have it display at all? In particularly, I do not want the menu button showing up first on the mobile screen, which it does when you have the navigation position set to “above header”.
May 20, 2015 at 11:17 pm #109267TomLead DeveloperLead DeveloperTo have it not display at all, you would add this CSS:
@media (max-width:768px) { .main-navigation { display: none; } }
To move it to the footer on mobile, you would have to use javascript.
For example, try adding this into your wp_footer hook:
<script type="text/javascript"> jQuery(window).load(function($) { var mobile, widthTimer; mobile = jQuery( '.menu-toggle' ); function generateMoveNav() { if ( mobile.is( ':visible' ) ) { jQuery('.main-navigation').insertBefore('.site-footer'); } else { jQuery('.main-navigation').insertBefore('.site-header'); } } if ( mobile.is( ':visible' ) ) { generateMoveNav(); } jQuery(window).resize(function() { clearTimeout(widthTimer); widthTimer = setTimeout(generateMoveNav, 100); }); }); </script>
July 6, 2017 at 2:10 am #344904SteveHello Tom,
your code dosnt seem to work anymore and if have some more requests:
first off, your latest update wa amazing – i really like that you can hide the menu while scrolling down with a click.
Iam thinking of moving the menu on mobile to the bottom while having it on top for desktop users, is that possible?
The hide on scroll down effect is neat but would be problematic if the menu was on bottom (in mobile) so is there away to only use it for desktop users ( i have no problem with deactivating it, if it is to complicated?Sorry to trouble you, and thank you for your time.
July 7, 2017 at 12:29 am #345447TomLead DeveloperLead DeveloperHi there,
The only way to do that would be to use the mobile header option.
It has the hide on scroll down functionality as well, but it’s a separate option so you can have it disabled while still having it enabled on desktop.
July 7, 2017 at 4:42 am #345522SteveHi Tom :D,
really nice idea I didnt see that^^.
i repositioned the mobile sticky menu with:
.mobile-header-navigation.is_stuck{ bottom: 0px; top: auto !important; }
Is that a good idea or should i care for something?
The opening direction seems to adjust automatically thats neat.Thank you for the help, have a nice day.
@edit: I just noticed that you dont see the footer anymore (menu is directly over it).
Should I fiddle with the footer margin if the mobile header is active or is there a more appropriate way?July 7, 2017 at 9:50 am #345659TomLead DeveloperLead DeveloperThat would be the only way to do it, but it will cover anything at the bottom of your viewport (as you mentioned).
You can adjust the
bottom
value to something higher if you want to offset it from the bottom.July 7, 2017 at 12:20 pm #345733SteveOkay, thank you.
July 7, 2017 at 7:30 pm #345857TomLead DeveloperLead DeveloperNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.