0
我目前正在製作一個產品負載頁面,需要按名稱,流行度和價格排序。歐洲貨幣格式的排序列表項目
我使用tinySort插件,它已對本國貨幣使用小數點的語言環境完美地工作,但它不是在這種格式的價格作爲'12歐洲語言環境中的工作這麼好,95€」
基本上,我需要一個函數將價格屬性轉換爲可排序的數字。
每個盒子使用下面的代碼
<li class="box" id="234860200" >
<img src="#" alt="" class="packshot" title="">
<p class="productTitle"></p>
<div class="bottomAlign">
<p><span class="price"></span> <span class="strikethrough strikeOFF"></span></p>
<input id="" type="checkbox" name="product" data-price="" class="calculation-item" value=""/>
<label for="" class="calculation-label"><span class="checkboxTitle"></span><span class="defaultAdd">Add to Basket</span></label>
</div>
<div class="clear"></div>
</li>
排序按鈕使用以下JS
function priceLow() {
$('ul#productList>li').tsort('span.price');
}
如果有人可以幫助我,那將是驚人的。