delay() or timeout with stop()?

前端 未结 4 564
生来不讨喜
生来不讨喜 2020-12-14 17:47
$(\'.file a\').live(\'mouseenter\', function() {
    $(\'#download\').stop(true, true).fadeIn(\'fast\');
}).live(\'mouseleave\', function() {
    $(\'#download\').st         


        
4条回答
  •  轮回少年
    2020-12-14 18:40

    you can use this on jquery without using delay event .

    $('.file a').hover(function() {
      time = setTimeout(function() {
         $('#download').fadeIn();
      },1000);
    },function(){
        clearTimeout(time);
    });
    

    1000 is your time that after it $('#download') will fade in .

提交回复
热议问题