I want to make html/jquery drop down menu. But I have a problem. I want that when mouse goes to "games" navigation button, div came down and only disappeared when the mouse is out FOR 5 seconds, not AFTER 5 seconds (this is my problem), not instantly. Here it is what I have done, so far
JS
var games_timer = $.timer(slidingUP("#games-sub", "-200px")); games_timer.set({ time : 3000, autostart : false });
function slidingUP($name, $value){
$($name).animate({ top : $value }, 300);
}
$(".games").hover(function(){
if (games_timer.active){games_timer.stop();}
$("#games-sub").animate({ top : "160px" }, 300);
}, function(){
games_timer.play();
});
It slides down, but never slides up
Html:
<ul>
<li class="nav-a1"><a id="home" href="">Home</a></li>
<li class="nav-a2"><a id="games" class="games" href="">Games</a></li>
<li class="nav-a2"><a id="upcomming" href="">Upcomming</a></li>
<li class="nav-a2"><a id="trailers" href="">Trailers</a></li>
<li class="nav-a2"><a id="blog" href="">Blog</a></li>
<li class="nav-a2"><a id="login" href="">Login</a></li>
</ul>
<div id="games-sub" class="games">
<a href="">ACTION</a>
<a href="">ADVANTURE</a>
<a href="">ARCADE</a>
<a href="">SHOOTER</a>
<a href="">FIRST PERSON</a>
<a href="">THIRD PERSON</a>
<a href="">STRATEGY</a>
<a href="">SPORT</a>
</div>