A client wants the alt tag text to appear when hovered (and can’t be convinced it should be title, alas). This is as far as I got, but I need only the hovered img’s alt tag to display, rather than all of them. I tried removing ‘each’ but it broke (I know I’m not very good at this). How do I fix it:
$("ul.thumb li img").hover(function() {
$(this).each(function(i, ele) {
$("li").append("<div class=alt>"+$(ele).attr("alt")+"</div>");
$(this).mouseleave(function(event){
$(".alt").css('display','none');
});
});
});
DEMO