我正在用 php、jquery 实现评论系统。我正在列出我需要在父评论下打开回复表单或框的评论。我的代码如下
HTML 代码是
<div id="record-1" class="friends_area">
<a href="javascript:;">
<img width="40" height="40" border="0" alt="" style="float:left; padding-right:9px;" src="">
</a>
<label class="name" style="float:left; width:390px;">
<span>
<span style="padding-left:10px;"> 59 minutes ago </span>
<br clear="all">
<div class="name" style="text-align:justify;float:left;">
<em> Dsffdfdfd</em>
<br clear="all">
<div style="height:10px;">
<a id="post_id1" class="showCommentBox" href="javascript: void(0)">Reply</a>
-
<span id="like-panel"> </span>
</div>
</div>
</label>
<a class="delete_p" href="#" style="color:#ff0000;"> Image </a>
<br clear="all">
<div id="CommentPosted1">
<div id="loadComments1" style="display:none"></div>
</div>
<div id="commentBox-1" class="commentBox" align="right" style="display:none"> </div>
</div>
<div id="record-1" class="friends_area">
<a href="javascript:;">
<img width="40" height="40" border="0" alt="" style="float:left; padding-right:9px;" src="">
</a>
<label class="name" style="float:left; width:390px;">
<span>
<span style="padding-left:20px;"> 59 minutes ago </span>
<br clear="all">
<div class="name" style="text-align:justify;float:left;">
<em> Dsffdfdfd</em>
<br clear="all">
<div style="height:20px;">
<a id="post_id2" class="showCommentBox" href="javascript: void(0)">Reply</a>
-
<span id="like-panel"> </span>
</div>
</div>
</label>
<a class="delete_p" href="#" style="color:#ff0000;"> Image </a>
<br clear="all">
<div id="CommentPosted2">
<div id="loadComments2" style="display:none"></div>
</div>
<div id="commentBox-2" class="commentBox" align="right" style="display:none"> </div>
</div>
My Reply Box
<div id="replymsgbox" style="display: none;">
<form id="frmComment" novalidate="novalidate" method="POST" name="frmComment">
<div>
<textarea id="comment_text" class="" name="comment[text]"></textarea>
<div id="error_text"> </div>
</div>
<div>
<input type="hidden" value="0" name="Parent_id" id=""Parent_id>
<input type="submit" value="Post" name="Submit">
</div>
</form>
</div>
我的jQuery:
//showCommentBox
$('a.showCommentBox').livequery("click", function(e){
var getpID = $(this).attr('id').replace('post_id','');
$('#replymsgbox', $(this).parents().next()).slideToggle('fast')
});
任何帮助表示赞赏!