开发者

Comment reply box when replying to comments

On my blog, HackSocialMedia.com, whenever you reply to other people's comments, the reply box(a div with id "respond") appears within the li container that houses the comment you are replying to. As a result开发者_StackOverflow社区, the reply box appears like so:

http://i.stack.imgur.com/g6kgC.png

I'm trying to modify it so that the reply box appears beneath the comment box(indicated by the border wrapping around it. Any ideas?

Example page with comments: http://hacksocialmedia.com/facebook/6-ways-to-protect-your-facebook-account/


It looks like you are just appending the new div at the end of the current paragraph. Instead I think you want to traverse up the DOM and find the li that is it's parent, then insert/append below here.

Using jQuery

$('.comment-reply-link').click(function() { 
    var parent = $(this).closest('li'); // Find the nearest li (parent)
    parent.append(addComment.moveForm("comment-reply-25", "25", "respond", "383"));

Something like that to get your started.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜