將這個您的JS文件中。它應該工作。或者按照這個例子。 https://codepen.io/ayang10/pen/BZzEWZ
var valueBubble = '<output class="rangeslider__value-bubble" />';
var rangeSlider1 = $('#first');
var rangeSlider2 = $('#second');
function updateValueBubble(pos, value, context) {
pos = pos || context.position;
value = value || context.value;
var $valueBubble = $('.rangeslider__value-bubble', context.$range);
var tempPosition = pos + context.grabPos;
var position = (tempPosition <= context.handleDimension) ? context.handleDimension : (tempPosition >= context.maxHandlePos) ? context.maxHandlePos : tempPosition;
if ($valueBubble.length) {
$valueBubble[0].style.left = Math.ceil(position) + 'px';
$valueBubble[0].innerHTML = value;
}
}
rangeSlider1
.rangeslider({
polyfill: false,
onInit: function() {
this.$range.append($(valueBubble));
updateValueBubble(null, null, this);
},
onSlide: function(pos, value) {
updateValueBubble(pos, value, this);
}
})
.on('input', function() {
rangeSlider2[0].value = this.value;
});
rangeSlider2
.rangeslider({
polyfill: false,
onInit: function() {
this.$range.append($(valueBubble));
updateValueBubble(null, null, this);
},
onSlide: function(pos, value) {
updateValueBubble(pos, value, this);
}
})
rangeSlider1.on('input', function() {
rangeSlider2.attr("min", this.value);
rangeSlider2.rangeslider('update', true);
});
我真的很感激它。非常感謝你的幫助!!! – Nanina
我很高興我可以幫忙(: –