Add/remove class to element with delay if mouse is still over : I am opening my submenu with adding a class("reveal") to it's parent. What i want to achieve is when i hover over a parent, if no "active" hover is going on, to open the submenu immediately, but if a submenu is already shown, then wait 1second before it opens a new one.
I want this because of "bad" mouse movement for it to wait in case the mouse leaves the submenu/parent to see if it re-enters in 1second.

I know there are a bunch of similar threads, but i already did my attempt and can't se eright now what im doing wrong:

    $('.menu > li').hover(function(){
        var ele = $(this);
        if($('.menu li.reveal').length > 0){
            var t = setTimeout(function(){
                if( ele.hover() ){
                    $('.menu li.reveal').removeClass('reveal');
                    ele.addClass('reveal');    
                }
            },1000);
        }
        else{
            ele.addClass('reveal');
        }
    });