我正在使用引导滑块http://seiyria.com/bootstrap-slider/作为贷款生成器。这里没问题。
但是我必须使用相同的滑块,一个在顶部,另一个在 SlideIn 框中,当顶部超出视口时会出现。
我的问题是如果我使用它的滑块是否有可能SlideSide
也会移动滑块并设置新值SlideTop
(就像我用鼠标滑动它一样)。
我有顶部滑块
$("#amount").on("slide", function () {
var amountNumber = $('#amount').val();
var amountStr = function (nStr) {
nStr = amountNumber;
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + '.' + '$2');
}
return x1 + x2 + " kr.";
}
var src = illustrationSource.concat(amountNumber.substring(0, 1) + ".svg");
illustrationWrapper.find("img").attr("src", src);
});
我的想法是这样的
$("#amount").on("slide", function () {
//Move slider on the amountSide and set the new value
});
这个想法是,如果用户正在使用 SlideIn 中的滑块并且由于某种原因关闭了 SlideIn 框,则顶部的滑块也将具有新值,并且可以像用户滑动一样查看滑块。