How to apply existing fade in effect code to new element
When you hover over an image I have a javascript element pop up (top image) and a css coded popup. Is there anyway of applying the fade effect of the second to the first or any other way of having the to开发者_Go百科p image fade in at all? Thanks
Fade out the current image, change it, then fade it in:
$('img').fadeOut(100,function() {
$(this).attr('src','newimg.png').fadeIn(100);
});
http://jsfiddle.net/3j45B/2/
精彩评论