我想在引導程序模型關閉時將ionRangeSlider'從'原值重置。但我無法重置它,因爲rangeSlider
未定義。ionRangeSlider未定義,無法更新
代碼:
$(document).ready(function() {
$(".order").ionRangeSlider({
min: 1,
max: 20,
type: 'single',
step: 1,
prettify: false,
hasGrid: false,
});
$('#settingsModal').on('hidden.bs.modal', function() {
// Find the range slider jquery element
var rangeSliderElement = $(this).closest('.well').first('.order');
// Get the start value
var startValue = rangeSliderElement.data('from');
// Get the ion range slider
var rangeSlider = rangeSliderElement.data("ionRangeSlider");
// Reset its value
rangeSlider.update({
from : startValue
});
});
});
我有我的頁面上有多個ionRangeSliders。
怎麼回事?