I have a list of items and i need to return only the items that the price is between the price range of "min" and "max".
Here is full working Example that sort the items by class, But as you can see the slider doesn't affect the price range, Here is the full code:
so, as you can see, Here is the .find and .filter code:
var price = data.find('li').filter(function() {
var price = parseFloat($(this).data('price'));
return price >= minPrice && price <= maxPrice;
});
Can you tell me what I'm doing wrong?
Finally! I found the solution, you simply have to call function with all vars
function showProducts($holder, data, minPrice, maxPrice) {
var $price = data.find('li').filter(function() {
var $price = parseInt($(this).data("price"), 10);
return $price >= minPrice && $price <= maxPrice;
});
// call quicksand and assign transition parameters
$holder.quicksand($price, {
duration: 800,
easing: 'easeInOutQuad'
});
return false;
}
Hope that help!