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?
Hi,
Thank you for your kind words!
1. The plugin changes the asp-compact attribute on the search from “closed” to “open”. So you can detect if the main container is open with this custom CSS:
.asp_m[asp-compact=open] {
/* styles here */
}
Although I’m afraid you cannot use this to change parent element styles, as currently as far as I know CSS implementation does not have a parent or custom node selector. I think the only possible solution here is use javascript, to perhaps detect a “click” event on the magnifier icon, and then check on the “asp-compact” value after a timeout, and then set the desired element to invisible.
2. This requires some custom javascript coding, starting off with something like this may help:
jQuery(function($){
$('.proclose').on('mouseup', function(e){
var $e = jQuery(this).closest('.asp_w');
ASP.instances[$e.data('id') + '_' + $e.data('instance')].closeCompact();
});
});