Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › 'Compact Mode' Question: Hiding Primary Navigation? › Reply To: 'Compact Mode' Question: Hiding Primary Navigation?
September 14, 2020 at 4:05 pm
#29355
Keymaster
Well, that is bit more difficult, but I would probably use the same event as you used for the menu toggle. Probably inject an element next to the magnifier icon, and style it via custom CSS. Then hide the element on the clicks:
jQuery(document).ready(function($) {
var open = false;
$('.promagnifier').on('click', function(){
$('#et-menu').toggle();
open = !open;
$icon = $(this).closest('.asp_w').find('.my-custom-icon');
if ( $icon.length == 0 ) {
$(this).after('<div class="my-custom-icon item-hidden"></div>');
}
if ( open ) {
$(this).closest('.asp_w').find('.promagnifier').addClass('item-hidden');
$icon.removeClass('item-hidden');
} else {
$(this).closest('.asp_w').find('.promagnifier').removeClass('item-hidden');
$icon.addClass('item-hidden');
}
});
});