获取 ion.rangeslider 值,乘以价格和底部所有滑块的总和
Get ion.rangeslider value, multiple by price and total all sliders at bottom
正在处理此代码笔:http://codepen.io/anon/pen/RrEbjB
每个滑块 15 美元,我需要在调整时获取滑块以更新底部的总数。所有 3 项都应适用于主要总数。
感谢任何有关让回调正常工作的帮助,我删除了我正在处理的代码,因为它破坏了一切...
$(function () {
$("#range1").ionRangeSlider({
min: 0,
max: 100,
hide_min_max: true
});
$("#range2").ionRangeSlider({
min: 0,
max: 100,
hide_min_max: true
});
$("#range3").ionRangeSlider({
min: 0,
max: 100,
hide_min_max: true
});
});
我想为了其他用户,我会 post 最后对我有用的代码。
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();
}
});
正在处理此代码笔:http://codepen.io/anon/pen/RrEbjB
每个滑块 15 美元,我需要在调整时获取滑块以更新底部的总数。所有 3 项都应适用于主要总数。
感谢任何有关让回调正常工作的帮助,我删除了我正在处理的代码,因为它破坏了一切...
$(function () {
$("#range1").ionRangeSlider({
min: 0,
max: 100,
hide_min_max: true
});
$("#range2").ionRangeSlider({
min: 0,
max: 100,
hide_min_max: true
});
$("#range3").ionRangeSlider({
min: 0,
max: 100,
hide_min_max: true
});
});
我想为了其他用户,我会 post 最后对我有用的代码。
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();
}
});