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);
精彩评论