0
我有以下代碼,當我點擊閱讀時,當前會打開所有的信息。我怎樣才能讓它們單獨打開?顯示隱藏/切換個人信息不能正常工作
$(document).ready(function() {
$(".readmore-content").hide();
$(".read-more").click(function(e) {
$(".readmore-content").toggle("slow");
e.preventDefault();
});
});
HTML
<div class="result-b">
<h4> lorem ipsum </h4>
<p>lorem ip sum soem <a href= "#" class="read-more">Read more</a> </p>
<div class="readmore-content">
lorem ipsum lorem ipsum lorem ipsum lorem ipsum
lorem ipsum
</div>
</div>
<div class="result-b">
<h4> lorem ipsum </h4>
<p>lorem ip sum soem <a href= "#" class="read-more">Read more</a> </p>
<div class="readmore-content">
lorem ipsum lorem ipsum lorem ipsum lorem ipsum
lorem ipsum
</div>
</div>