I´m new here.. sorry for my bad English :D
I´m looking for a range slider with fixed values and additional text output.
Here is a example: http://james2013.batcave.net/s100.htm
<p>
</p><div id="resolution-slider" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" aria-disabled="false"><a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 0%;"></a></div>
<div id="resolution"></div>
<div class="resolution-preview">6</div>
<h4>Slider width is set in css for this page</h4>
<script>
$(document).ready(function(){
var valMap = [6, 10, 12, 18 , 35, 56];
$("#resolution-slider").slider({
value: valMap[0], // Start slider from first (0th) element
max: valMap.length-1, // Set "max" attribute to array length minus 1
min: 0,
values: [0],
create: function( event, ui ) { // Place numeric value on page before slide
$(".resolution-preview").html(valMap[0]);
},
slide: function(event, ui) {
$("#resolution").val(valMap[ui.values[0]]); // Fetch selected value from array
$(".resolution-preview").html(valMap[ui.values[0]]);
}
});
});
</script>
If the number 18 is displayed, a text that applies only to this value must also be displayed.
If a different number is selected, a different text will appear.
Thanks for the help guys <3