Question

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');
    });         
});
Was it helpful?

Solution

This should get you all non-image containing links -

$('a:not(:has(img))')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top