如果鼠标位于弹出窗口上方,jquery mouseover 不会隐藏元素
我的元素很少,通过在每个元素上移动鼠标,在鼠标在每个元素上花费几秒钟后,应该会出现弹出窗口。我通过以下脚本完成了这一点,
var timeOutUserInfo;
$('a[datatype=popupAboutUser]').live({
mouseenter: function() {
timeOutUserInfo = setTimeout(function(){
$('#popupUserInfo').show();
}, 1000);
return false;
},
mouseleave: function (e) {
clearTimeout(timeOutUserInfo);
$('#popupUserInfo').fadeOut(250);
}
});
问题是,如果用户应该将鼠标移动到 #popupUserInfo 上,但只要他这样做,弹出窗口就会隐藏。 我尝试了一些方法来检查鼠标是否位于该弹出窗口上,如果没有,则隐藏它,但无法这样做。
有什么解决办法吗?
I have few elements and by moving the mouse on each of them, popup window should appear, after the mouse spend few second on each of them. This I have done by the following script
var timeOutUserInfo;
$('a[datatype=popupAboutUser]').live({
mouseenter: function() {
timeOutUserInfo = setTimeout(function(){
$('#popupUserInfo').show();
}, 1000);
return false;
},
mouseleave: function (e) {
clearTimeout(timeOutUserInfo);
$('#popupUserInfo').fadeOut(250);
}
});
the problem is that if the user should move the mouse on the #popupUserInfo, but as far as he does it, popup hides.
I have try a few things with checking if the mouse is over that popup and if not - to hide it, but was not able to do so.
Are there any solutions for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个...
Try this...