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
Post a Comment