Skip to content Skip to sidebar Skip to footer

How To Open Reply Form Under Comments Div

I am having div of the comments like
Some message over here

Solution 2:

Solution 3:

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

    $(this).parent().parent().next().slideToggle("slow");

});  

Here is the test: http://jsfiddle.net/2HczB/

I used with next() because I saw on your code you tried to do with this way. It's better to call immediately the id of the div. However with my solution you can open exactly the reply after the message you clicked reply.

Solution 4:

EXAMPLE

$('a.showReply').on("click", function(e){ 
   $('#replymsgbox').slideToggle('fast')   
});

You'll also need some padding or space between the two divs to make sure the content doesn't overlap. In the example I just added a <br/>.

Please note the change from .live to .on, as it is now deprecated.

See Here:

As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers.

​Make sure the document is ready as well by putting your jQuery code within $(document).ready(function{ ... }). I'm sure you're probably already doing this and just pasted the relevant code, but always good to make sure.

Post a Comment for "How To Open Reply Form Under Comments Div"