jQuery实时鼠标输入延迟

jQuery live mouseenter delay

本文关键字:延迟 输入 鼠标 实时 jQuery      更新时间:2023-09-26

我想在匿名函数调用mouseenter事件之前延迟2秒。这里的代码是完美的工作,但我想延迟初始动画或悬停2秒,似乎不能弄清楚。

$('div#response div.results').live({
    mouseenter: function() {
        $(this).find('.zoomer').stop('true').css({
            'z-index': '999'
        }).animate({
            "overflow": 'visible',
            backgroundColor: '#fff',
            'width': '274px'
        }, {
            duration: 100,
            easing: 'easeOutExpo',
            queue: false
        });
        $(this).find('img').stop('true').animate({
            "height": "180px",
            "width": "270px"
        }, {
            duration: 1,
            easing: 'linear',
            queue: false
        });
    },
    mouseleave: function() {
        $(this).find('.zoomer').stop('true').animate({
            "overflow": 'visible',
            backgroundColor: '#f7f7f7',
            'width': '164px'
        }, {
            duration: 10,
            easing: 'linear',
            queue: false
        });
        $(this).find('img').stop('true').animate({
            "height": "108px",
            "width": "162px"
        }, {
            duration: 1,
            easing: 'easeOutCirc',
            queue: false
        })
    }
});
mouseenter:
       function()
       {
            setTimeout(function(){  
                 //your code
             }, 2000);
        }
$(this).find('.zoomer')...delay(2000).animate(...

使用延迟功能?