アプリで行われたいくつかの変更で、ブートストラップ スライダーの値を更新しようとしています。
これを与えていerror : $(...).setAttribute is not a function
ます。
この問題は既に gitHub で記録されています https://github.com/seiyria/bootstrap-slider/issues/451
提案された変更を行いました
if (updateSlider === true) {
if (Array.isArray(this.options.ticks_labels) && this.options.ticks_labels.length > 0) {
for (i = 0; i < this.options.ticks_labels.length; i++) {
this.tickLabels[i].innerHTML = this.options.ticks_labels[i]
}
}
}
これはそれを更新しているコードです。
function UpdateMonthSlider(month)
{
var updtdArray = GetTicksArray(month.MonthMin, month.MonthMax, monthStep);
$('#monthSlider').setAttribute("ticks", updtdArray);
$('#monthSlider').setAttribute("ticks_labels", GetFormattedLabels(updtdArray, 'months', false));
$('#monthSlider').slider('refresh');
}
エラーを表示するサンプル フィドル: jsfiddle.net/mo6v9x7h/2