我正在使用此代码过滤价格的asc和desc ... 问题是当我使用5位数值进行过滤而不是正常工作时
$(".deskprice1").click(function () {
var filterType = $(this).attr("data-filter"); // return data-price
var type = $(this).attr("data-sort"); // return asc or desc
$('.flight-list .filter').sortElements(function (a, b) {
// one by one prices
return type == "asc" ? ($(a).attr(filterType) > $(b).attr(filterType) ? 1 : -1) : ($(b).attr(filterType) > $(a).attr(filterType) ? 1 : -1);
});
type = type == "asc" ? "dasc" : "asc";
$(this).attr("data-sort", type);
});