jQueryは、画像であるものを除くリンクをフェードするリンク?
質問
私はjqueryで非常にシンプルなスクリプトをプログラムしました。アイデアは、すべてのリンクを不透明でフェードすることです を除外する 画像であるリンク。
これが私のコードです:
$('#content_wrapper a, #footer_wrapper a, .dcmenu_market_link a').not('a img').each(function() {
$(this).css("opacity", "0.6");
$(this).hover(function() {
$(this).addClass('fade');
$(this).stop().animate({ opacity: 1.0 }, 600);
},
function() {
$(this).stop().animate({ opacity: 0.6 }, 600);
$(this).removeClass('fade');
});
});
解決
これにより、リンクを含むすべての非イメージを取得するはずです -
$('a:not(:has(img))')
所属していません StackOverflow