Dilettante_Pro,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.slider{
width: 300px;
margin: 10px;
}
</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/south-street/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script>
$(function() {
var arr = [[30,40],[50,60],[70,80],[90,100]],
rm = $("#rooms"),
sq = $("#square");
rm.slider({
min: 1,
max: 4,
step: 1,
values: [1,2],
range: true,
slide: function(event, ui) {
var ar = [];
ar[0] = arr[ui.values[0] - 1][0];
ar[1] = arr[ui.values[1] - 1][1];
sq.slider("option","values",ar);
}
});
sq.slider({
min: 30,
max: 100,
step: 10,
values: [30,50],
range: true,
slide: function(event, ui) {
var ar = rm.slider("option","values");
for (var i = 0; i < arr.length; i++){
if(ui.values[0] <= arr[i][0]) {
ar[0] = i + 1;
break;
}
}
for (var i = 0; i < arr.length; i++){
if(ui.values[1] >= arr[i][0]) ar[1] = i + 1;
}
rm.slider("option","values",ar);
}
})
});
</script>
</head>
<body>
<div class="slider" id="rooms"></div>
<div class="slider" id="square"></div>
</body>
</html>