How to move the mouse into the element for two seconds and then execute addclass

how to move the mouse over the element for two seconds and then execute addclass
or not execute addclass within two seconds after executing the addclass event



<ul class="flul">
<li class="flli"></li>
<li class="flli"></li>
<li class="flli"></li>
<li class="flli"></li>
<li class="flli"></li>
</ul>


var cflul = $(".flul");
var cflli = $(".flli");
cflli.eq(index).addClass("flli_curr");
    cfrli.eq(index).show();
    cflli.hover(function(){
        index = $(this).index();
        $(this).addClass("flli_curr").siblings().removeClass("flli_curr");
        cfrli.eq(index).show().siblings().hide();
    });
Apr.18,2021
Learn about the anti-jitter throttling of

js. Share a blog post
JavaScript and learn anti-shaking from underscore


$(document).ready(function () {
            var handle = null;
            $('-sharpdiv1').mouseover(function () {
                handle = setTimeout(function () {
                    alert("1")
                }, 1000);
            }).mouseout(function () {
                clearTimeout(handle);
                alert("2")
            });
        });
Menu