私のHtmlは次のようになります
<h3><a href="#" title="story title">Story Title</a>
<img class="expandstory" src="/images/plus.png" /></h3>
<div class="description">Short description about the story</div>
<h3><a href="#" title="story title">Story Title</a>
<img class="expandstory" src="/images/plus.png" /></h3>
<div class="description">Short description about the story</div>
私のjqueryは次のようになります
$(".expandstory").click(function() {
$(".description").slideUp(500);
$(this).parent().nextAll('.description:first').slideToggle(500);
$(this).attr('src','/images/minus.png');
});
すべて正常に動作します。しかし、マイナス画像をクリックすると、divが折りたたまれて再び展開されます。div を折りたたんで展開しないようにする方法。前もって感謝します。