¿Enlaces de desvanecimiento de jQuery excepto los que son imágenes?
Pregunta
He programado un script muy simple con jQuery. La idea es desvanecer todos los enlaces con opacidad excepto enlaces que son imágenes.
Aquí está mi código:
$('#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');
});
});
Solución
Esto debería obtener todos los enlaces que no contienen imágenes -
$('a:not(:has(img))')
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow