div class mc-filter__item mc-filter__item_slid er label class mc-filte

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<div class="mc-filter__item mc-filter__item_slider">
<label class="mc-filter__item-label"><?=$arItem["NAME"]?></label>
<script type="text/javascript">
$(function() {
var itemId = '<?=$itemId?>';
var sliderContainerId = '#mc-price-range-' + itemId;
var lowerPriceContainerId = '#mc-lower-price-' + itemId;
var upperPriceContainerId = '#mc-upper-price-' + itemId;
var arSteps = {41:1, 13:100};
var step = arSteps[ itemId ];
$(sliderContainerId).noUiSlider({
range: [<?=$arItem["VALUES"]["MIN"]["VALUE"]?>, <?=$arItem["VALUES"]["MAX"]["VALUE"]?>],
start: [<?=$arItem["VALUES"]["MIN"]["HTML_VALUE"] ? $arItem["VALUES"]["MIN"]["HTML_VALUE"] : $arItem["VALUES"]["MIN"]["VALUE"]?>,
<?=$arItem["VALUES"]["MAX"]["HTML_VALUE"] ? $arItem["VALUES"]["MAX"]["HTML_VALUE"] : $arItem["VALUES"]["MAX"]["VALUE"]?>],
connect: true,
step: step,
behaviour: 'tap-drag',
resolution: 0.1,
slide: function() {
var currentPrice = $(sliderContainerId).val();
$(sliderContainerId + ' .noUi-handle-lower').text(parseInt(currentPrice[0]));
$(sliderContainerId + ' .noUi-handle-upper').text(parseInt(currentPrice[1]));
$(lowerPriceContainerId).val(parseInt(currentPrice[0]));
$(upperPriceContainerId).val(parseInt(currentPrice[1]));
}
});
$(sliderContainerId + ' .noUi-handle-lower').text(parseInt($(sliderContainerId).val()[0]));
$(sliderContainerId + ' .noUi-handle-upper').text(parseInt($(sliderContainerId).val()[1]));
$(lowerPriceContainerId).val(parseInt($(sliderContainerId).val()[0]));
$(upperPriceContainerId).val(parseInt($(sliderContainerId).val()[1]));
});
</script>
<div class="mc-filter__item-slider">
<div id="mc-price-range-<?=$itemId?>" class="_js-price-range mc-price-range"></div>
<input id="mc-lower-price-<?=$itemId?>" name="<?echo $arItem["VALUES"]["MIN"]["CONTROL_NAME"]?>" class="_hidden mc-lower-price" value="<?echo $arItem["VALUES"]["MIN"]["HTML_VALUE"]?>" type="text" size="5">
<input id="mc-upper-price-<?=$itemId?>" name="<?echo $arItem["VALUES"]["MAX"]["CONTROL_NAME"]?>" class="_hidden mc-upper-price" value="<?echo $arItem["VALUES"]["MAX"]["HTML_VALUE"]?>" type="text" size="5">
</div>
</div>