You can use JQUERY on focusout, on focusin, or blur with the following function:
$("#id-do-componente").on("focusout",function() {
$('#id-do-componente-a-remover').addClass("id-da-classe");
}
In other words, when your main component loses the focus that would be the center you will add the class referring to the formatting that hides it. You can create in CSS for example and apply a class to the div class.
<div class="menu-remove">
</div>
no css:
.menu-remove{
display:none
}
In this case our jquery function would be:
$("#id-do-componente").on("focusout",function() {
$('#id-do-componente-a-remover').addClass("menu-remove");
}
The focusin works if the component "wins the attention", ie a mouse click or tab to it, the blur is when you lose any focus, the structure would change to that form:
$("#id-do-componente").blur(function() {
$('#id-do-componente-a-remover').addClass("menu-remove");
}
Sample Code;
php / html code:
<div id="botao-centro">
<div id="conteudo-centro">
//Conteudo do menu do botão centro
</div>
</div>
CSS code:
#botao-centro{
//Conteudo css botao centro
}
#conteudo-centro {
//Conteudo css menu centro
}
#conteudo-centro .menu-remove{
display:none,
}
jquery code:
$("#botao-centro").on("focusout",function() {
$('#conteudo-centro').addClass("menu-remove");
}