我的HTML看起来像jQuery的崩溃点击展开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>
<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崩溃,不扩大。提前致谢。
他试图打开他点击了一个前关闭所有其它描述的工作版本 – Bill 2013-05-01 09:50:30