<span id="min_block">0</span>
<span id="max_block">50000</span>
<div id="slider"></div>
<script type="text/javascript">
$( "#slider" ).slider({
range: true,
min: 0,
max: 50000,
values: [ 0, 50000 ],
change: function( event, ui ) {
var left0 = $(ui.handle[ 0 ]).css("left");
var left1 = $(ui.handle[ 1 ]).css("left");
$("#min_block").html(ui.values[ 0 ]).css({left : left0});
$("#max_block").html(ui.values[ 1 ]).css({left : left1});
},
slide: function( event, ui ) {
var left0 = $(ui.handle[ 0 ]).css("left");
var left1 = $(ui.handle[ 1 ]).css("left");
$("#min_block").html(ui.values[ 0 ]).css({left : left0});
$("#max_block").html(ui.values[ 1 ]).css({left : left1});
$( "#min_block" ).val( ui.values[ 0 ] );
$( "#max_block" ).val( ui.values[ 1 ] );
}
});
</script>
ui.handle[ 0 ]
Как правильно определять индекс?
|