Tagged: x
-
AuthorPosts
-
December 14, 2016 at 3:14 am #1292438
niqujaggaParticipantHi there
I’m working on this for the last few hours but it’s not working out really. There are many posts about this matter and I tried many different Java-Script solutions but none of them worked out perfecty.
Its this page I’m talking about: Link
At the moment, i put the following code into the customizer:
jQuery(document).ready(function($) { $('.x-navbar .x-nav-wrap.mobile a').on('click touchstart',function(){ $('.x-btn-navbar').click(); }); });The problem here is, that the outgoing links on my onepage don’t work anymore. With the classic #links, it works fine.
I found this one:
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(); } }); });…which is not working at all.
Can you help me out on this?
December 14, 2016 at 4:32 am #1292501
LelyModeratorHi There,
Can you try using this code instead:
jQuery(function($){ $('#menu-item-489>a, #menu-item-287>a').on('click touchend', function(e) { window.location = $(this).attr('href'); }); });Hope this helps.
December 14, 2016 at 9:27 pm #1293731
niqujaggaParticipantHello!
So just to be clear: It’s working now but I’m using this one:
jQuery(document).ready(function($) { $('.x-navbar .x-nav-wrap.mobile a').on('click touchstart',function(){ $('.x-btn-navbar').click(); }); });AND this aswell:
jQuery(function($){ $('#menu-item-489>a, #menu-item-287>a').on('click touchend', function(e) { window.location = $(this).attr('href'); }); });Do i understand right, that the second one defines the exceptions and has to be updated, when the menu changes?
thanks for the support!
December 14, 2016 at 11:42 pm #1293835
RadModeratorHi there,
Yes, you’re correct. You’ll have to match #menu-item-287 to your new menu item in case you change it.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1292438 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
