streleca_stz
Registered
Здравейте! Искам да ви попитам как би могло да стане ако някой цъкне на линк Коментар да му се появи textarea за попълване на коментар? 
Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
Styl3rbg каза:[js]<script type="text/javascript">
function comment() {
$("#com").slideToggle("slow");
}
</script>[/js]
Трябва ти и JqueryHTML:<a onClick="comment()">pokaji</a><div id="com" style="display: none; border-top: none; text-align: left;">>dsadsa</div>![]()
Ами правиш го такаstreleca_stz каза:Styl3rbg каза:[js]<script type="text/javascript">
function comment() {
$("#com").slideToggle("slow");
}
</script>[/js]
Трябва ти и JqueryHTML:<a onClick="comment()">pokaji</a><div id="com" style="display: none; border-top: none; text-align: left;">>dsadsa</div>![]()
По принцип работи, но само ако се използва 1 път на страница.. а на мен ми трябва за резултати които са в цикъл.. :X
while($row = mysql_fetch_assoc($query)) {
echo '
<script type="text/javascript">
function comment'.$row['id'].'() {
$("#com'.$row['id'].'").slideToggle("slow");
}
</script>
<a onClick="comment'.$row['id'].'()">pokaji</a><div id="com'.$row['id'].'" style="display: none; border-top: none; text-align: left;">>dsadsa</div>
';
}
<script>
$(function() {
$('.showarea').click(function() {
var id= $(this).attr("id");
var num = parseInt(id);
$(this).after('<div id="com' + num + '" style="display: none; border-top: none; text-align: left;">>dsadsa</div>');
});
});
</script>
while($row = mysql_fetch_assoc($query)) {
echo '<a class="showarea" id="show'.$row['id'].'">pokaji</a>';
}