0
I am trying to create a menu where the search bar appears only after the li's
of the menu vanish, for that, I recommended the function .delay()
of jquery
, but I am not able to realize these effects, it plays directly the search and removes directly the li's
Jquery
$('#abre-busca').click(function(event){
event.preventDefault();
$('#menu-principal-sub li').css({'opacity':0});
$('#menu-principal-sub li').css({'display':'none'}).delay(500);
$('#menu-principal-sub form').css({'display':'inline-block'}).delay(500);
$('#menu-principal-sub form').css({'opacity':1}).delay(500);
})
HTML
<ul id="menu-principal-sub">
<li><a href="#">Home</a></li>
<li><a href="#">Quem somos</a></li>
<li><a href="#">Como participar</a></li>
<li><href="" id="abre-busca">Busca</a></li><!-- chamada da busca -->
<form id="barra-busca"><!-- Form de busca -->
<fieldset>
<input type="text">
<button type="submit"></button>
</fieldset>
</form>
</ul>
How could it do such an effect ?
how could I do, so that when clicking outside the form it would perform the inverse ?
– Murilo Melo