是否有任何理由讓我的jQuery效果不會立即生效?我有jQuery懸停淡入淡出效果,但後來我也有CSS翻轉作爲備份的JavaScript禁用的任何人。發生什麼事情是當你加載一個頁面並滾動一個鏈接時,你會得到CSS效果,但隨後的任何時候,你都會得到很好的,流暢的jQuery效果。每一個環節都必須重複。有沒有解決這個問題?jQuery沒有立即生效
我jQuery代碼是這樣的:
$(document).ready(function() {
$(".nav-link").hover(function() {
$(this).animate({ color: "#669900" }, 250);
return false;
},
function() {
$(this).animate({ color: "#999999" }, 250);
});
$(".twit-link").hover(function() {
$(this).animate({ color: "#0099CC" }, 250);
return false;
},
function() {
$(this).animate({ color: "#999999" }, 250);
});
$(".rss-link").hover(function() {
$(this).animate({ color: "#CC6600" }, 250);
return false;
},
function() {
$(this).animate({ color: "#999999" }, 250);
});
$(".sidebar-item").hover(function() {
$(this).animate({ color: "#669900"}, 250);
return false;
},
function() {
$(this).animate({ color: "#333333"}, 250);
});
$(".archive-link").hover(function() {
$(this).animate({ color: "#666666"}, 250);
return false;
},
function() {
$(this).animate({ color: "#999999"}, 250);
});
$(".sub").hover(function() {
$(this).animate({ 'background-color': '#336600'}, 250);
return false;
},
function() {
$(this).animate({ 'background-color': '#669900'}, 250);
});
$(".post-sb").hover(function() {
$(this).animate({ 'opacity': 1.0,
'filter': 'alpha(opacity = 100)'}, 250);
return false;
},
function() {
$(this).animate({ 'opacity': .25,
'filter': 'alpha(opacity = 25)'}, 250);
});
});
我從谷歌(http://code.jquery.com/jquery-latest.pack.js)
讓我的jQuery直我使用Safari。 現在,我正在用MAMP測試我的網站,所以它在我的計算機上的本地,但最終它會去到外部服務器。
你可以發佈你的jQuery代碼嗎?這會有很大的幫助。 – 2010-03-08 22:36:09
你能說你正在使用哪個瀏覽器,以及你從哪裏爲jQuery提供服務?在某些瀏覽器中,您可以看到與HTML文件關聯的資源下載需要多長時間。 (Chrome中的Ctrl + Shift + J) – 2010-03-08 22:36:40
這是生活/在外部服務器還是在您自己的計算機上? – 2010-03-08 22:44:08