The code below does this: visitor clicks on the menu, it slides in horizontally, from the left side. Visitor clicks on menu again, it slides out (closes).
What I want is: the same behavior. But also: if menu is open and visitor does not click anywhere, menu slides out (closes) after 5 seconds.
Thank you for your help!
var clicked = 0;
function header() {
$('#header').click(
function(){
if(clicked === 0){
$(this).stop().animate({ paddingLeft: '230px'}, {queue: false, duration: 400 });
clicked = 1;
} else if(clicked === 1){
$(this).stop().animate({ paddingLeft: '0'});
clicked = 0;
}
}
);
}