There is such code:
Js :
$(document).ready(function(){ var idsdfsd = $("#idpostcom").text(); $("#idrcom-"+ idsdfsd).click(function(){ $("#hidden-"+ idsdfsd).slideToggle("slow"); return false; }); }); HTML | PHP :
<div class='bottom'> $likeordislike - <a class='hider' id='idrcom-$posttid'>ΠΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ ($clcomment[0])</a> <div class='cllike'> <span id='cllike-".$post[id]."'>$cllike[0]</span> </div> </div> <div class='blcomments' id='hidden-$posttid' style='display: none;'> $blmesscomments ". ((($clcomment[0] !== '0') AND ($posttid == $commentpost)) ? "$blcomments" : "") . " <div class='blgocomment' style='padding: 0px;'> <textarea placeholder='ΠΡΡΠ°Π²ΠΈΡΡ ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΉ...' id='txtcom-$posttid'></textarea> <br /> <div id='idpostcom' style='display: none;'>141</div> <a onclick='postComment($(this));' class='btnredprof' style='float: right; margin-top: 5px; margin-bottom: 5px;'>ΠΠΎΠ±Π°Π²ΠΈΡΡ</a> </div> </div> This is a slider (when you click on the button, the content unfolds).
The problem is that there are a lot of such html-blocks, how to make it so that when pressed in a block, the button drops out just below it?
I set id ( $posttid ) on each block.
I tried to implement this way:
$(document).ready(function hidercom(){ $(".hider").click(function(){ $("#hidden").slideToggle("slow"); return false; }); }); <a class='hider' onClick='hidercom($(this));'>ΠΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ ($clcomment[0])</a> Still not working.
idon the page matches theidin the script - Dmitriy Kondratiuk