开发者

Fading In A prepended element in jquery

开发者 https://www.devze.com 2023-02-11 05:59 出处:网络
I\'ve got some code like this: var newrootcomment = $(\"<div class=\'comment\'><div class=\'comment-holder\'><div class=\'comment-body\'>\"+ data.message + \"&开发者_如何学Golt;/div

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

精彩评论

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