【发布时间】:2017-06-01 12:46:41
【问题描述】:
我的 jquery 悬停在桌面视图中有问题。每次我悬停(鼠标移出)父导航时,子页面都不会关闭,在我悬停后,子页面保持打开状态。如何解决这个悬停问题,当我每次悬停时子页面也会隐藏。
我正在使用此代码
jQuery('.dropdown').hover(function(){
if(!jQuery('.navbar-toggle').is(':visible')) { // disable for mobile view
if(!jQuery(this).hasClass('open')) { // Keeps it open when hover it again
jQuery('.dropdown-toggle', this).trigger('click');
}
}
});
请查看图片以获得更好的可视化效果
【问题讨论】:
-
能否包含相关的 HTML 和 CSS?
标签: javascript jquery css hover