您好我現在用鼠標離開()下拉導航菜單中,這樣當用戶離開子菜單下拉子菜單中消失,但它似乎忽略它,菜單依然存在。有任何想法嗎?下面是該網站並代碼:jQuery的鼠標離開()被忽略
http://www.maiagifts.co.uk/about-us/info_1.html
$(document).ready(function() {
$('#newcats li').addClass('parentitem');
$('.newsubs li').removeClass('parentitem');
$('.newsubs').hide();
$('.parentitem').hover(
function(){
$(this).children('.newsubs').show();
$(this).siblings('.parentitem').children('.newsubs').hide();
});
//problem is here//
$('.newsubs').mouseleave(
function(){
$(this).hide();
});
//problem is here//
});
將不適用於OP。嘗試$(「body」)。在問題 –
$(selector).live的鏈接的開發控制檯上爲我工作 – Francisco