我目前使用此代码:延迟jQuery的.live鼠标悬停功能
$('#startLabel').live('mouseover',function(){
$('.startTooltip').fadeIn();
});
$('#startLabel').live('mouseout',function(){
$('.startTooltip').fadeOut();
});
当用户将鼠标悬停在#startLabel DIV显示工具提示股利和隐藏工具提示,当用户移动光标了。
我想改变这一点,以便在#startLabel div被悬停3秒后才会出现工具提示,有人能告诉我怎么做到这一点吗?
我已经试过这样:
$('#startLabel').live('mouseover',function(){
setTimeout(function() {
$('.startTooltip').fadeIn();
}, 3000);
});
但提示如果您快速将鼠标悬停在它,然后悬停客场仍然出现。
感谢您的任何帮助。
看到http://api.jquery.com/delay/ –