Делаю range slider с помощью jquery_ui, вот код:
<div class="min-max__wrapper">
<div class="price-range__min-max price-range__min">
<label for="min-price">От</label>
<input type="number" class="form-control" id="min-price" value="<?php echo $extremes->min_price; ?>">
</div>
<div class="price-range__min-max price-range__max">
<label for="max-price">До</label>
<input type="number" class="form-control" id="max-price" value="<?php echo $extremes->max_price; ?>">
</div>
</div>
<div id="slider-range"></div>
скрипт:
min_price = jQuery('#min-price').val();
max_price = jQuery('#max-price').val();
jQuery("#slider-range").slider({
range: true,
min: Number(min_price),
max: Number(max_price),
values: [min_price, max_price],
slide: function(event, ui) {
jQuery("#min-price").val(ui.values[0]);
jQuery("#max-price").val(ui.values[1]);
}
});
jQuery('#min-price').val(jQuery("#slider-range").slider("values", 0));
jQuery('#max-price').val(jQuery("#slider-range").slider("values", 1));
в консоли браузера:
Uncaught TypeError: t.toFixed is not a function
at t.<computed>.<computed>._calculateNewMax (jquery-ui.min.js?ver=5.3.2:6)
at t.<computed>.<computed>._calculateNewMax (jquery-ui.min.js?ver=5.3.2:6)
at t.<computed>.<computed>._create (jquery-ui.min.js?ver=5.3.2:6)
at t.<computed>.<computed>._create (jquery-ui.min.js?ver=5.3.2:6)
at t.<computed>.<computed>._createWidget (jquery-ui.min.js?ver=5.3.2:6)
at new t.<computed>.<computed> (jquery-ui.min.js?ver=5.3.2:6)
at HTMLDivElement.<anonymous> (jquery-ui.min.js?ver=5.3.2:6)
at Function.each (jquery.js?ver=1.12.4-wp:2)
at e.fn.init.each (jquery.js?ver=1.12.4-wp:2)
at e.fn.init.t.fn.<computed> [as slider] (jquery-ui.min.js?ver=5.3.2:6)