sniffysko,
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>slider demo</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/south-street/jquery-ui.css">
<style>
#slider-range { margin: 10px; width: 500px }
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<body>
<input id="val1">
<input id="val2">
<div id="slider-range"></div>
<script>
$("#slider-range").slider({
range: true,
min: 6,
max: 30,
values: [12,20],
animate: true,
slide: function( event, ui ) {
if(ui.values[1] - ui.values[0] < 2 ) return false;
$('#val1').val(ui.values[0]);
$('#val2').val(ui.values[1]);
}
});
$( "#val1" ).val( $( "#slider-range" ).slider( "values", 0 ));
$( "#val2" ).val( $( "#slider-range" ).slider( "values", 1 ));
</script>
</body>
</html>