我想合并两个输入范围可拖动的拇指,并在它们重叠时停止拖动。我还想更改范围轨道的颜色,但是input::-moz-range-track
不起作用。
这是我当前的代码。
.price-slider {
position: relative;
width: 420px;
margin: 0 auto 20px;
height: .8em;
text-align: center;
}
.price-slider input {
pointer-events: none;
position: absolute;
left: 0;
top: 15px;
width: 100%;
outline: none;
height: .8em;
margin: 0;
padding: 0;
border: 1px solid #aaa;
-webkit-appearance: none;
}
.price-slider input::-webkit-slider-thumb {
pointer-events: all;
position: relative;
z-index: 1;
outline: 0;
background-color: #1E86D2;
border: 1px solid #d3d3d3;
width: 1.2em;
height: 1.2em;
-webkit-appearance: none;
}
.price-slider input::-moz-range-thumb {
pointer-events: all;
position: relative;
z-index: 1;
outline: 0;
widows: 24px;
border-radius: 12px;
background-color: white;
border: 2px solid black;
-moz-appearance: none;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<div class="price-slider">
<input type="range" min="0" #range1 value="0" max="100" step="1" (input)="range1.value" (mouseup)="stop(range1.value, range2.value)">
<input type="range" min="0" #range2 value="100" max="100" step="1" (input)="range2.value">
<label for=""> Range: {{ range2.value - range1.value }} </label>
</div>
希望有人会帮助我。预先谢谢你。