我用的是hoverIntent和购物袋(#袋容器),一切都很好。
function bagOver(){
$(this).find("#bagContainer").stop().fadeTo('fast', 1).show();
}
function bagOut(){
$(this).find("#bagContainer").stop().fadeTo('fast', 0, function() {
$(this).hide();
});
}
var bagHoverConfig = {
over: bagOver,
bagTimeout: 3000,
out: bagOut
};
$("#userBox .row:nth-child(2)").hoverIntent(bagHoverConfig);但我需要在包中添加一个“额外”的关闭按钮(#bagCollapser),类似于:
$("#bagCollapser").click(function () {
$('#bagContainer').hide();
});它关闭#袋容器,但似乎与hoverIntent有冲突:
有什么想法吗?
提前谢谢!
发布于 2017-03-21 15:08:47
我也有同样的问题,我使用hoverIntent来显示一个超级游戏。在这个超级游戏中,我创建了一个关闭按钮:
$("#closebutton").click(function () {
$('#megasubmenu').hide();
$('#megasubmenu').closest('li.level0').find('a.level0').removeClass("megahover");
});关闭按钮关闭子菜单,但hoverIntent函数仍在运行,因为一旦鼠标移动,子菜单就会重新出现.
https://stackoverflow.com/questions/5615310
复制相似问题