javascript - JQuery mouseenter() and mouseleave() -


so have got demo navigation, has small button on side , when hover button, slides menu window. though have got hover working, when mouse leaves, it's still open. how fix this? i'm pretty new jquery way

here's html:

<div id="demonav">     <button class="open"></button>     <ul>         <li><a href="index.html">home pagina</a></li>         <li><a href="product.html">product pagina</a></li>         <li><a href="bestel.html">bestel pagina</a></li>     </ul> </div> 

and jquery:

$("#demonav").mouseenter(function(){        $("#demonav").animate({marginleft:'0px'}, 500) }); 

if need more info, tell me, i'll provide more codes.

try this:

$("#demonav").hover(  function () {     $(this).animate({         marginleft: '0px'     }, 500) },  function () {     $(this).animate({         marginleft: '50px'     }, 500) }); 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -