我想为了其他用户,我最终会发布对我有用的代码。
function sum () {
var total = (a * 15) + (b * 15) + (c * 15);
$total.text(total);
}
function sum2 () {
var totals = (a * 15) + (b * 15) + (c * 15);
var k = Number(totals) + Number( $('#other_amount').val());
$grand_total.text(k);
}
$('#other_amount').change(function() {
sum2();
});
$("#range1").ionRangeSlider({
min: 0,
max: 25,
postfix: " in Basket",
hide_min_max: true,
hide_from_to: false,
grid: true,
keyboard: true,
keyboard_step: 1,
force_edges: true,
onChange: function (data) {
a = data.from;
sum();
sum2();
}
});
$("#range2").ionRangeSlider({
min: 0,
max: 25,
postfix: " in Basket",
hide_min_max: true,
hide_from_to: false,
grid: true,
keyboard: true,
keyboard_step: 1,
force_edges: true,
onChange: function (data) {
b = data.from;
sum();
sum2();
}
});
$("#range3").ionRangeSlider({
min: 0,
max: 25,
postfix: " in Basket",
hide_min_max: true,
hide_from_to: false,
grid: true,
keyboard: true,
keyboard_step: 1,
force_edges: true,
onChange: function (data) {
c = data.from;
sum();
sum2();
}
});