【发布时间】:2013-05-01 09:45:55
【问题描述】:
我的 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 折叠而不是展开。提前致谢。
【问题讨论】: