'); var action = 'fetch_data'; var minimum_price = $('#hidden_minimum_price').val(); var maximum_price = $('#hidden_maximum_price').val(); var brand = get_filter('brand'); var ram = get_filter('ram'); var storage = get_filter('storage'); var category = $('#category').val(); // alert('action:'+action+' min:'+minimum_price+' max:'+maximum_price+' brand: '+brand); $.ajax({ url:"http://samadhancity.com/cl/tent-decoration-/amVFZTFCK1QzT1dvQXhLb24wK0U3dz09", method:"get", data:{minimum_price:minimum_price, maximum_price:maximum_price}, success:function(data){ $('.filter_data').html(data); $('#display_brand_data').hide(); } }); } function get_filter(class_name) { var filter = []; $('.'+class_name+':checked').each(function(){ filter.push($(this).val()); }); return filter; } $('.common_selector').click(function(){ filter_data(); }); var maxprice = parseInt($('.maxprice').val()); var maximum_price = parseInt($('#hidden_maximum_price').val(maxprice)); // var min_price_range = $('#minpricerange').val(0); // var max_price_range = $('#maxpricerange').val(maxprice); $('#maxp').val(maxprice); var gap = 1; $('#min_max_btn').on('click',function(){ var min_price_range = parseInt($('#minpricerange').val()); var max_price_range = parseInt($('#maxpricerange').val()); if(min_price_range > max_price_range){ $('#minpricerange').val(0); $('#hidden_minimum_price').val(0); $('#hidden_maximum_price').val(max_price_range); $("#price_range").slider({ values: [0, max_price_range], }); }else{ $('#hidden_minimum_price').val(min_price_range); $('#hidden_maximum_price').val(max_price_range); $("#price_range").slider({ values: [min_price_range, max_price_range], }); $('#maxp').val(max_price_range); } filter_data(); }); var min_price_range = $('#minpricerange').val(); var max_price_range = $('#maxpricerange').val(); var maxp = $('#hidden_maximum_price').val(); // $('#price_show').html('0 - '+price_show+'') $('#price_range').slider({ range:true, min:0, max:maxp, values:[0, maxp], step:5, stop:function(event, ui) { $('#hidden_minimum_price').val(ui.values[0]); $('#hidden_maximum_price').val(ui.values[1]); $('#minpricerange').val(ui.values[0]); $('#maxpricerange').val(ui.values[1]); filter_data(); } }); });