[英]jQuery live mouseenter delay
我想延遲2秒,然后再在mouseenter事件上調用匿名函數。 這是運行良好的代碼,但我想將初始動畫或鼠標懸停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(...
使用延遲功能?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.