Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Ajax search pro mobile issue › Reply To: Ajax search pro mobile issue
April 17, 2020 at 7:59 am
#26789
Keymaster
Hi,
I see the code on the site footer, you put it to the correct location – the end of the functions.php file is perfectly fine, although it does not matter.
Maybe the menu is initialized later, after this code is executed, so it has no effect. Can you try this variation, I added a delay to it:
add_action( 'wp_footer', 'asp_try_fixing_menu_close', 99999999 );
function asp_try_fixing_menu_close() {
?>
<script>
jQuery(function($){
setTimeout(function(){
$('.menu-item a').on('touchstart', (function(e){
if ( $(this).find('.promagnifier').length > 0 ) {
$(this).off();
}
}));
}, 1500);
});
</script>
<?php
}
I’m almost certain, that this will do it.