我有一系列產生的產品的其中有些看起來像這樣重新安排了一系列產生的div使用javascript
<div class="product"><div class="productImage" title="one"></div></div>
<div class="product"><div class="productImage" title="two"></div></div>
<div class="product"><div class="productImage" title="three"></div></div>
<div class="product"><div class="productImage" title="four"></div></div>
有沒有一種方法,我可以把它們放在一個陣列使用JavaScript來展現他們在不同的順序?
無法解決它。任何建議?
what I have right now
<div class="product">
<div class="productImage" title="Elixer Altima">product image goes here with other shopping features</div>
</div>
<div class="product">
<div class="productImage" title="Bain Oleo Relax">product image goes here with other shopping features</div>
</div>
<div class="product">
<div class="productImage" title="Satin">product image goes here with other shopping features</div>
</div>
<div class="product">
<div class="productImage" title="Hair Cream">product image goes here with other shopping features</div>
</div>
New Order to be
<div class="product">
<div class="productImage" title="Hair Cream">product image goes here with other shopping features</div>
</div>
<div class="product">
<div class="productImage" title="Satin">product image goes here with other shopping features</div>
</div>
<div class="product">
<div class="productImage" title="Bain Oleo Relax"></div>
</div>
<div class="product">
<div class="productImage" title="Elixer Altima">product image goes here with other shopping features</div>
</div>
你想用什麼命令他們出現,或什麼決定的順序? – Sampson
可以改變基於HTML的任何部分的順序...取決於你想要什麼 – charlietfl
沒有特定的順序。我正在嘗試閱讀標題並將其放在優先位置。例如三個,一個,四個,兩個。 – soum