开发者

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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜