문제

I have programmed a very simple script with jQuery. The idea is to fade all links with opacity except links that are images.

Here is my code:

$('#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');
    });         
});
도움이 되었습니까?

해결책

This should get you all non-image containing links -

$('a:not(:has(img))')
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top