Collapsed navigation links

Hi,

I am using a collapsed navigation in the header for mobile devices on this site - http://service2-mady.temp-dns.com/

Parent links weren’t linking so I added some jQuery that I found which works fine but it has changed the other links so that they have to be clicked twice to work, could you help so that the parent links work with just one click please? Excluding the parent dropdown links.

The jQuery:

jQuery( function($) {

$(document).on('click','.x-menu-collapsed .x-anchor-sub-indicator', function() {
//We can use stop propagation here, but that also prevents the sub-menu toggle effect
$(this).parent().parent().data('link', false);
} );

$(document).on('click', '.x-menu-collapsed a.x-anchor-menu-item', function(){

if ( $(this).data('link') !== true ) { //Don't link when the arrow down icon is clicked

$(this).data('link', true);

return false;

}

var url = $(this).attr('href');

if ( url.split('//').length == 2 ) { 
// the length will be always two if https://, http://, or just // is present

window.location = url;

}

} );


} );

Hi there,

Please try the code suggested here:

Hope this helps.

Hi,

Thanks for the help but links that have a dropdown still don’t link through.

Please try the code provided in this thread https://theme.co/apex/forum/t/top-level-links-not-working-on-mobile/16258/2?u=christian_y

Thanks.

Hi Christian,

Thanks very much for that it worked perfectly.

Glad to hear it!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.