0

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');
    });         
});
4

1 に答える 1

0

これにより、画像を含まないリンクがすべて取得されます-

$('a:not(:has(img))')
于 2011-10-19T12:37:34.650 に答える