Сообщение от RadCor
|
Нужен простой
|
простого нет, есть сложный
<!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/le-frog/jquery-ui.css">
<style>
#slider-range{
margin:20px;
width:500px;
height:5px;
}
#show{
position: relative;
width: 30px;
top: 5px;
}
.ui-slider-handle{
margin-top: -0.2em;
border-radius:50%;
position:relative;
font-size:14px;
display:block;
}
:focus{
outline:0;
border:0;
}
</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>
<script>
$(function() {
$( "#slider-range" ).slider({
min: 36,
max: 160,
value: 36,
step: 2 ,
slide: function( event, ui ) {
var left = $(ui.handle).css("left");
$("#show").html(ui.value).css({left : left} )
$('#price').html(ui.value + ' - ' + (ui.value*25 + 490));
},
change: function(event, ui) {
var left = $(ui.handle).css("left");
$("#show").html(ui.value).css({left : left} )
$('#price').html(ui.value + ' - ' + (ui.value*25 + 490));
}
});
});
</script>
</head>
<body>
<div id="show">36</div>
<div id="slider-range" ></div>
<div id="price">36 - 1390</div>
</body>
</html>