Alena-stav,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
body {
font-family: sans-serif;
font-size: 12px;
}
.amount{
font-size: 22px;
font-weight: bold;
border:none;
color: #ff5555;
background: none;
}
.slider{
width: 300px;
margin: 20px;
}
.radio {
display: inline;
}
.opt [type="checkbox"] + *{
display: none;
}
.opt :checked + *{
display: block;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/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>
<script>
$(function() {
var data = [
[500, 600, 100],
[500, 700, 100]
];
var price = {
500: {
500: 1000,
600: 2000,
700: 2100
},
600: {
500: 2000,
600: 2050,
700: 2200
}
};
function out() {
var p = $(".opt .amount").get();
var width = p[0].value;
var height = p[1].value;
var res = price[width] && price[width][height] || "уточните цену у консультанта";
$(".res").html(res)
}
$(".opt").each(function(i, el) {
var d = data[i],
am = $(".amount", el),
sl =
$(".slider", el);
sl.slider({
min: d[0],
max: d[1],
step: d[2],
slide: function(event, ui) {
am.val(ui.value);
out()
},
change: function(event, ui) {
am.val(ui.value);
out()
},
stop: out
});
sl.slider("option", "value", d[0])
})
});
</script>
</head>
<body>
<div class="opt">
<div class="slider"></div>
<input type="text" class="amount" readonly>
</div>
<div class="opt">
<div class="slider"></div>
<input type="text" class="amount" readonly>
</div>
<div class="res">0</div>
</body>
</html>