开发者

Fading In A prepended element in jquery

I've got some code like this:

var newrootcomment = $("<div class='comment'><div class='comment-holder'><div class='comment-body'>"+ data.message + "&开发者_如何学Golt;/div> <abbr class='timestamp' title=''></abbr><div class='aut'>" + data.author + "</div> <a href='#comment_form' class='reply' id=''>Reply</a> </div> </div>");

$('#wholecontainer').prepend(newrootcomment).hide().fadeIn(300);

Basically, I'm prepending the code to the #wholecontainer div. however, I want the prepended code and fade it into view. The above code fades in all the #wholecontainer div. How can I actually do it?


Try

newrootcomment.prependTo($('#wholecontainer')).hide().fadeIn(300);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜