开发者

How to apply existing fade in effect code to new element

开发者 https://www.devze.com 2023-04-07 11:42 出处:网络
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

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

精彩评论

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