如何打开回复表单下的评论div [英] how to open reply form under comments div

查看:163
本文介绍了如何打开回复表单下的评论div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有评论的div

 < div> 
< div>
这里有一些消息
< / div>
< div style =height:10px;> < a id =post_id_1class =showReplyhref =javascript:void(0)>回复< / a>< / div>
< / div>

我的回复框

 < div id =replymsgboxstyle =display:none;> 
< form id =frmCommentnovalidate =novalidatemethod =POSTname =frmComment>
< div>
< textarea id =comment_textclass =name =comment [text]>< / textarea>
< div id =error_text> < / div>
< / div>
< div>
< input type =submitvalue =Postname =Submit>
< / div>
< / form>
< / div>

我的Jquery:

  // showCommentBox 

$('a.showReply')。live(click,function(e){

$('#replymsgbox ',$(this).parent()。next())。slideToggle('fast')

});

任何人都会帮助我。我无法打开回复div或表单。

  $('a.showReply')。on(click,function(e){

$('#replymsgbox')。slideToggle 'fast')

});


I am having div of the comments like

<div>
  <div>
    Some message over here
   </div>
   <div style = "height:10px;"> <a id = "post_id_1" class = "showReply" href = "javascript: void(0)">Reply</a></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="submit" value="Post" name="Submit">
        </div>
    </form>
</div>    

My Jquery :

//showCommentBox

$('a.showReply').live("click", function(e){ 

$('#replymsgbox', $(this).parent().next()).slideToggle('fast')

});    

Will any one help me out. I am not able to open reply div or form. where I am doing wrong

解决方案

Use following with latest version of jQuery.

$('a.showReply').on("click", function(e){ 

   $('#replymsgbox').slideToggle('fast')

});    

这篇关于如何打开回复表单下的评论div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆