Home > Web Front-end > JS Tutorial > js hover timer (example code)_Basic knowledge

js hover timer (example code)_Basic knowledge

WBOY
Release: 2016-05-16 17:16:01
Original
1352 people have browsed it

复制代码 代码如下:

$("#showComp tr:not('.stlisttitle')").hover(function(){
        try{if($("#calendarPanel").is(":visible")) $(".playerlist").hide();else{clearTimeout(timMess);
        $(".playerlist").css("top",$(this).offset().top-$(".calendarCon").offset().top-30).show();}}catch(e){}

    },function(){
        timMess=setTimeout(function(){
            $(".playerlist").hide();
         },300);

        //$(this).css("background","");
    });   
    $(".playerlist").hover(function(){
        clearTimeout(timMess);
    },function(){
        timMess=setTimeout(function(){

            $(".playerlist").hide();

         },300);
    });


效果如图:
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template