I have a dropUp menu with the following:
$(document).ready(function(){
var opened = false;
$("#menu_tab").click(function(){
if(opened){
$("#menu_box").animate({"top": "+=83px"}, "slow");
setTimeout(function(){
$("#menu_box").animate({"top": "+=83px"}, "slow");
}, 2000);
clearTimeout();
}else{
$("#menu_box").animate({"top": "-=83px"}, "slow");
}
$("#menu_content").slideToggle("slow");
$("#menu_tab .close").toggle();
opened = opened ? false : true;
});
});
So after clicking on the menu_tab, the menu drops up and stays up until clicked again, but I'd like a timeout so that after say 2 seconds the menu drops down again.
I've obviously got the coding wrong because the timeout isn't working. Any help would be appreciated! TIA.