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 回答