我爲滑塊創建了一個jQuery迷你腳本。它在Firefox,Chrome,IE9中完美工作,但當我懸停在IE7,IE8中。它顯示一個警告錯誤(未定義的current_hover_item)。IE8中的jQuery未定義變量
$('.nav-item').hover(function(){
var current_hover_item = $(this).children().attr('rel');
$('.show-item').hide();
$(current_hover_item).fadeIn(1000);
$(this).animate({"width": "+=10px", opacity: 0.6}, 500, function(){
$(this).animate({"width": "-=10px", opacity: 1}, 500);
});
}, function(){
$(current_hover_item).fadeOut(1000);
return false;
});
我試圖刪除(VAR)關鍵字,但是當我懸停,它不會顯示一切。 請幫幫我。謝謝。
謝謝。我試過你的代碼,但在我的情況下,這是行不通的。 –