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;
}
} );
} );