我有一個包含兩列的主列表。在這些列中,每個div都有多個類,當您選擇其中一個類時,我想要排列這些列以使它們均勻。這裏是我開始用的一個例子:jQuery對兩列內的div進行排序
<div class="left">
<div class="dot blue">blue one</div>
<div class="dot red">red one</div>
<div class="dot orange">orange one</div>
<div class="dot red">red two</div>
<div class="dot red">red three</div>
</div>
<div class="right">
<div class="dot red">red four</div>
<div class="dot blue">blue two</div>
<div class="dot blue">blue three</div>
<div class="dot blue">blue four</div>
<div class="dot orange">orange two</div>
</div>
點擊撥動按鈕,我對「紅」之後,我想隱藏一切,除了紅點,但兩者之間的紅色的均勻排序列。我可以正確隱藏所有內容,但不知道如何在「左」和「右」div之間製作四個紅色div。這裏是我想要的輸出:
<div class="left">
<div class="dot red">red one</div>
<div class="dot red">red two</div>
</div>
<div class="right">
<div class="dot red">red three</div>
<div class="dot red">red four</div>
</div>
在此先感謝。
納米小姐讀... – defaultNINJA 2013-02-21 16:00:25