0
我使用jQuery基金會頂酒吧2.0.1基金會下拉閉幕
重現步驟: 1.將鼠標移到 2.下拉打開菜單項,將鼠標移動到落下 3.鼠標鼠標關閉下拉
行爲在IE中:下拉在Chrome/Firefox的關閉
行爲:下拉保持開放
這裏的菜單HTML是什麼樣子:
<nav class="top-bar">
<section class="top-bar-section">
<ul>
<li class="headerItem"><a href="#">Home</a></li>
<li class="has-dropdown headerItem">
<a href="#">Engine Product</a>
<ul class="dropdown">
<li><a href="#">Perkins Engines</a></li>
<li><a href="#">Isuzu Engines</a></li>
<li><a href="#">FPT PowerTrain</a></li>
<li><a href="#">ISS Engines</a></li>
<li><a href="#">Mitsubishi Engines</a></li>
</ul>
</li>
</ul>
</section>
</nav>
展望foundation.topbar.js它看起來像這樣的功能是當懸停CSS類添加/從菜單項
.on('mouseenter mouseleave', '.top-bar li', function (e) {
if (!self.settings.is_hover) return;
if (/enter|over/i.test(e.type)) {
$(this).addClass('hover');
} else {
$(this).removeClass('hover');
}
})
我加了一個快速的記錄語句刪除看到控制這是怎麼回事
console.log('target: ' + e.target.innerHTML + ' event: ' + e.type);
在IE中:
target: Engine Product event: mouseenter
target: Perkins Engines event: mouseenter
target: Perkins Engines event: mouseleave
target: Perkins Engines event: mouseleave
在鍍鉻/火狐
target: Engine Product event: mouseenter
target: Perkins Engines event: mouseenter
target: Perkins Engines event: mouseleave
我真的不知道該怎麼做這個