This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: 'Compact Mode' Question: Hiding Primary Navigation?

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?

#29355
Ernest MarcinkoErnest Marcinko
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');
		}
	});
});