我的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