I'm trying to create a menu where the search bar appears only after the li's
of the menu are gone, for that, they recommended me the .delay()
function of jquery
, but I'm not able to achieve these effects, directly search and directly remove 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 you do such an effect?