我想根据我输入的值更改Slider的值。(可编辑的滑块)
<!--- HTML Code--------->
<div class="form-group" id="AmountdivId">
<label class="control-label">Advance amount</label>
<div class="col-sm-4 pull-right">
<input type="text" id="AmountID" class="form-control" />
</div>
</div>
//javascript code
jQuery(document).ready(function() {
// Basic Slider: Success
jQuery('#slider-success').slider({
orientation: "horizontal",
range: "min",
min: 0,
max: 20000,
value: 15000,
slide: function(event, ui) {
$("#amount").val(ui.value);
$("#FundingAmtClass").val(ui.value);
$('#AmountID').val(ui.value);
},
});
答案 0 :(得分:0)
您必须向输入处理程序
添加操作$('#AmountID').change(function() {
var newvalue = $(this).val();
$('#slider-success').slider( 'value', newvalue );
$(this).val( newvalue );
});