切換我目前有無法更改過濾器的div類。我想要一個.toggle,所以當一個部分被點擊時,其餘部分隱藏到下一個類「.refinement_custom_category_section」。目前它幾乎可以工作,它只是隱藏了該部分下面的所有內容,當我只想在點擊時隱藏該部分。JQuery停止在類
<div class="refinement_custom_category_section">Find by Condition</div>
<div class="refinement_filter"><a href="">New (52)</a></div>
<div class="refinement_filter"><a href="">Used (7)</a></div>
<div class="refinement_filter"><a href="">Overstock - New (2)</a></div>
<div class="refinement_custom_category_section">Find by Section</div>
<div class="refinement_filter"><a href="">1 Section (2)</a></div>
<div class="refinement_filter"><a href="">2 Section (40)</a></div>
<div class="refinement_filter"><a href="">3 Section (19)</a></div>
<div class="refinement_custom_category_section">Find by Door Type</div>
<div class="refinement_filter"><a href="">Solid Door (34)</a></div>
<div class="refinement_filter"><a href="">Glass Door, Sliding (6)</a></div>
<div class="refinement_filter"><a href="">Glass Door, Swing (21)</a></div>
<div class="refinement_custom_category_section">Find by Exterior</div>
<div class="refinement_filter"><a href="">Black (33)</a></div>
<div class="refinement_filter"><a href="">Stainless Steel (28)</a></div>
<div class="refinement_custom_category_section">Find by Height</div>
<div class="refinement_filter"><a href="">34.5 inches (12)</a></div>
<div class="refinement_filter"><a href="">35.625 inches (16)</a></div>
<div class="refinement_filter"><a href="">35.875 inches (11)</a></div>
<div class="refinement_filter"><a href="">37 inches (20)</a></div>
<div class="refinement_filter"><a href="">38.75 inches (2)</a></div>
</div>
<script>
$(".refinement_custom_category_section").click(function() {
$(this).nextAll("div.refinement_filter").toggle("fast");
});
</script>
真棒,工作非常感謝你! – ToddN 2011-02-11 17:13:43