Tagged: x
-
AuthorPosts
-
January 28, 2017 at 8:00 pm #1349209
Nayuk01Participanthttp://www.holcombwebdesign.com
The menu is working correctly but after the page scrolls to a different section, the menu does not stay on the screen.
Thank you
Naomi
January 29, 2017 at 2:13 am #1349381
Rue NelModeratorHello Naomi,
Thanks for writing in! To make the menu positioned at the top or fixed top position on smaller devices, please add the following css code in the customizer, Appearance > Customize > Custom > CSS
@media (max-width: 979px){ .x-navbar-fixed-top { position: fixed; } }And then after clicking, to make sure that the menu will close, please add the following JS code in the customizer, Appearance > Customize > Custom > Javascript
jQuery(function($){ $('.x-nav li a').click(function(e){ var hash = $(this).attr('href').split("#").slice(-1)[0]; var outbound = /^https?:\/\//i; if(hash && !outbound.test( $(this).attr('href') )) { e.preventDefault(); $('html,body').animate({ scrollTop: $('#' + hash ).offset().top - $('header.masthead').height() },700 ,'swing'); $('.x-btn-navbar').click(); } }); });We would loved to know if this has work for you. Thank you.
February 6, 2017 at 10:12 pm #1360620
Nayuk01ParticipantWorked perfectly. Thank you!
I do have one more question relating to it though. Is there a way to make the drop-down menu automatically close (but menu icon remain at the top of the screen) on scrolling so that the menu doesn’t take up the majority of the screen? Rather than having to do it manually.
Thank you again
Naomi
February 7, 2017 at 1:20 am #1360773
Paul RModeratorHi Naomi,
You can add this in Appearance > Customize > Custom > Javascript
jQuery(function($){ $(".x-navbar .mobile .x-nav li > a").on( "click", function() { $('.x-btn-navbar').click(); }); });Hope that helps.
February 7, 2017 at 10:34 am #1361381
Nayuk01ParticipantHey Paul,
That last one did not work unfortunately. Is there anything else I can try?
Thanks
Naomi
February 7, 2017 at 11:41 am #1361496
JadeModeratorHi Naomi,
Please update this code:
jQuery(function($){ $('.x-nav li a').click(function(e){ var hash = $(this).attr('href').split("#").slice(-1)[0]; var outbound = /^https?:\/\//i; if(hash && !outbound.test( $(this).attr('href') )) { e.preventDefault(); $('html,body').animate({ scrollTop: $('#' + hash ).offset().top - $('header.masthead').height() },700 ,'swing'); $('.x-btn-navbar').click(); } }); });to
jQuery(function($){ $('.x-nav li a').click(function(e){ var hash = $(this).attr('href').split("#").slice(-1)[0]; var outbound = /^https?:\/\//i; if(hash && !outbound.test( $(this).attr('href') )) { e.preventDefault(); $('html,body').animate({ scrollTop: $('#' + hash ).offset().top - $('header.masthead').height() },700 ,'swing'); $('.x-btn-navbar').click(); } }); $('.mobile .x-nav a').on('touchend click', function(){ $('.x-btn-navbar').click(); }); });Hope this helps.
February 7, 2017 at 4:21 pm #1361846
Nayuk01ParticipantI believe I changed it correctly but it’s still the same on my phone unfortunately.
Naomi
February 8, 2017 at 12:24 am #1362378
Paul RModeratorHi,
In that case, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1349209 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
