с css позже тогда помучаюсь, как это лучше визуализировать, а по механике вот:
body {
font-family: sans-serif;
font-size: 12px;
}
#amount, #amount2, #amount3, #amount4, #amount5 {
font-size: 22px;
font-weight: bold;
border:none;
color: #ff5555;
background: none;
}
#slider, #slider2, #slider3, #slider4 {
width: 300px;
}
.radio {
display: inline;
}
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js">
</script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<p class="radio"><input type="radio" name="xradio" value="40" checked>RADIO1</p><p class="radio"><input type="radio" name="xradio" value="50">RADIO2</p><p class="radio"><input type="radio" name="xradio" value="100">RADIO3</p>
<p>
<input type="text" id="amount" readonly>
</p>
<div id="slider"></div>
<p>
<input type="text" id="amount2" readonly>
</p>
<div id="slider2"></div>
<p>
<input type="text" id="amount4" value="0" readonly>
</p>
<div id="slider3"></div>
<p>
<input type="text" id="amount5" value="0" readonly>
</p>
<div id="slider4"></div>
<p>
<input type="text" id="amount3" readonly>
</p>
</body>
$(function() {
itnm = 40
var price = {
50: {
1: itnm*50+900*1,
2: itnm*50+900*2,
3: itnm*50+900*3,
4: itnm*50+900*4,
5: itnm*50+900*5,
6: itnm*50+900*6,
},
75: {
1: itnm*75+900*1,
2: itnm*75+900*2,
3: itnm*75+900*3,
4: itnm*75+900*4,
5: itnm*75+900*5,
6: itnm*75+900*6,
},
100: {
2: itnm*100+900*2,
3: itnm*100+900*3,
4: itnm*100+900*4,
5: itnm*100+900*5,
6: itnm*100+900*6,
},
125: {
2: itnm*125+900*2,
3: itnm*125+900*3,
4: itnm*125+900*4,
5: itnm*125+900*5,
6: itnm*125+900*6,
},
150: {
2: itnm*150+900*2,
3: itnm*150+900*3,
4: itnm*150+900*4,
5: itnm*150+900*5,
6: itnm*150+900*6,
},
175: {
2: itnm*175+900*2,
3: itnm*175+900*3,
4: itnm*175+900*4,
5: itnm*175+900*5,
6: itnm*175+900*6,
},
200: {
3: itnm*200+900*3,
4: itnm*200+900*4,
5: itnm*200+900*5,
6: itnm*200+900*6,
},
225: {
3: itnm*225+900*3,
4: itnm*225+900*4,
5: itnm*225+900*5,
6: itnm*225+900*6,
},
};
function comb(a) {
return Object.keys(a)
}
var steps = comb(price);
var num = steps[0];
var steps2 = comb(price[num]);
$("#slider2").slider({
value: 0,
min: 0,
max: steps2.length - 1,
step: 1,
slide: function(event, ui) {
var Y = steps2[ui.value];
$("#amount2").val(Y);
$("#amount3").val(price[num][Y]);
},
change: function(event, ui) {
var Y = steps2[ui.value];
$("#amount2").val(Y);
$("#amount3").val(price[num][Y]);
}
});
$("#slider").slider({
value: 0,
min: 0,
max: steps.length - 1,
step: 1,
slide: function(event, ui) {
num = steps[ui.value];
$("#amount").val(num);
steps2 = comb(price[num]);
$("#slider2").slider("option","max", steps2.length - 1);
$("#slider2").slider("option", "value", 0)
},
change: function(event, ui) {
num = steps[ui.value];
$("#amount").val(num);
steps2 = comb(price[num]);
$("#slider2").slider("option","max", steps2.length - 1);
$("#slider2").slider("option", "value", 0)
}
});
$("#slider3").slider({
value: 0,
min: 0,
max: 6,
step: 1,
slide: function( event, ui ) {
$( "#amount4" ).val( ui.value );
},
change: function(event, ui) {
$( "#amount4" ).val( ui.value );
}
});
$("#slider4").slider({
value: 0,
min: 0,
max: 350,
step: 5,
slide: function( event, ui ) {
$( "#amount5" ).val( ui.value );
},
change: function(event, ui) {
$( "#amount5" ).val( ui.value );
}
});
$("#slider").slider("option", "value", 0)
});
Тут у меня сразу ступор с прибавкой к сумме по результатам 1 и 2го ползуна... В общем к amount3 нужно + amount4*1800 и + amount5*10.. часа 3 уже колдую хреновня какаят нерабочая получается да и только =\
запилил в джсбин:
http://jsbin.com/ziwoqilula/edit?html,css,js,output