jQuery の効果がすぐに有効にならない理由はありますか? 私は jQuery ホバー フェード効果を持っていますが、JavaScript を無効にしている人のバックアップとして CSS ロールオーバーも持っています。ページを読み込んでリンクにカーソルを合わせると、CSS 効果が得られますが、その後はいつでも、素晴らしく滑らかな 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);
});
});
jQuery を Google から直接取得しています ( http://code.jquery.com/jquery-latest.pack.js )
サファリを使用しています。現在、私は自分のサイトを MAMP でテストしているので、自分のコンピューターではローカルですが、最終的には外部サーバーに移動します。