附加一个有淡入淡出效果的元素[jQuery] [英] Append an element with fade in effect [jQuery]

查看:118
本文介绍了附加一个有淡入淡出效果的元素[jQuery]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  var html =< div id ='blah'> Hello stuff here< / div& 

$(#mycontent)。append(html).fadeIn(999);

这似乎不起作用。



注意:我只想要新的blahdiv来淡入,而不是整个mycontent

  $(html).hide()。appendTo(#mycontent .fadeIn(1000); 


var html = "<div id='blah'>Hello stuff here</div>"

$("#mycontent").append(html).fadeIn(999);

This doesn't seem to work.

I just want a cool effect when the content gets appended.

Note: I want just the new "blah" div to fade in, not the entire "mycontent".

解决方案

$(html).hide().appendTo("#mycontent").fadeIn(1000);

这篇关于附加一个有淡入淡出效果的元素[jQuery]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆