单滑块 -演示
https://codepen.io/ssuryar/pen/PoZEBgm
HTML
<div id="slider-range"></div>
CSS
.ui-draggable, .ui-droppable {
background-position: top;
}
.ui-widget-header {background: #006fba;}
.value { position: absolute; top: 30px; left: 50%; margin: 0 0 0 -20px; width: 40px; text-align: center; display: block; font-weight: normal;}
jQuery
$( function() {
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
$('.ui-slider-handle:eq(0) .price-range-min').html('$' + ui.values[ 0 ]);
$('.ui-slider-handle:eq(1) .price-range-max').html('$' + ui.values[ 1 ]);
}
});
$('.ui-slider-handle:eq(0)').append('<span class="price-range-min value">$' + $('#slider-range').slider('values', 0) + '</span>');
$('.ui-slider-handle:eq(1)').append('<span class="price-range-max value">$' + $('#slider-range').slider('values', 1) + '</span>');
} );