我有这样的jQuery代码在这里:jQuery的隐藏仅此回复
$(".replies_hide").click(function(e) {
$(".replies_show").show(); // This is only button code. Not replies
$(".replies").hide(300); // I need to hide only these replies. Not all replies
e.preventDefault();
});
当我点击“显示回复”按钮,它让我看到了具体的意见的答复。但是,当我点击“回复_隐藏”时,它会立即关闭所有回复。如何只隐藏我刚刚打开的回复?
HTML:
<ul class="list-unstyled replies">
<a class="replies_hide" href="#">Hide replies</a>
@foreach($com->reply as $reply)
<li style="margin-left: 5%">
<img src="http://flipbit.co.uk/content/images/blog/build-avatar.jpg" style="height: 30px">
<strong>{{$reply->user->name}}</strong>
{!! strtr(strip_tags($reply->reply), $emotes) !!}<br>
<small>{{$reply->created_at}}</small>
@if(Auth::user()->id == $reply->user_id)
<a href="/trinti-atsakyma/{{$reply->id}}">Trinti</a>
@endif
</li>
@endforeach
</ul>
的问题是,它只是隐藏称为“隐藏的答复”,但没有答复 –
可以添加HTML标记的按钮? – guradio
能否请您发表您的HTML? – Ibanez