Tagged: Burger Menu, gtranslate, language selector
Dear people at the support forum,
I am creating a website on this domain:
For translating, I am using the plugin GTranslate.
It works fine on desktop, however on mobile, clicking the flags in the burger menu doens’t do anything.
I have contacted GTranslate and this is their respone:
I see your burger menu is being generated dynamically based on the desktop menu and it is controlled by wp-content/themes/enfold/js/avia-snippet-hamburger-menu.min.js
Make sure that when it copies language selector elements the javascript events are preserved.
Is there any code that you can give me to fix this problem?
Any help will be highly appreciated!
maybe it is a working way to have an explicite mobile menu – because the other solution is to have a child-theme avia-snippet-hamburger-menu.js file.
____________________________________________
you have to look for this part inside:
if( cur_menu.length )
{
if( cur_menu.get(0).hash == '#' || 'undefined' == typeof cur_menu.attr('href') || cur_menu.attr('href') == '#' )
{
// eventhandler conflict 'click' by megamenu (returns false) - ignore all handlers
if( subitems.length > 0 || megacolumns.length > 0 )
{
clone_events = false;
}
}
}
and replace it by:
// AVOID CONFLICT: Keep events for the GTranslate menu item
if( ! current.hasClass('menu-item-gtranslate') )
{
if( cur_menu.length )
{
if( cur_menu.get(0).hash == '#' || 'undefined' == typeof cur_menu.attr('href') || cur_menu.attr('href') == '#' )
{
// eventhandler conflict 'click' by megamenu (returns false) - ignore all handlers
if( subitems.length > 0 || megacolumns.length > 0 )
{
clone_events = false;
}
}
}
}
you know how to have a child-theme replacement script?