Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slider control for volume - JQuery/Javascript

I am looking for a fancy Slider control using JQuery/Javascript. The native JQuery slider is rather bland for this requirement. The slider will be used to specify the volume in the increments of 5. So, this slider should only let user slide in increments of 5.

One nice to have feature is to be able to show label above the slider position indicating what volume the user has selected.

like image 744
DotnetDude Avatar asked Mar 05 '10 23:03

DotnetDude


1 Answers

Here's an example of the customization you're after that uses the jQuery UI Slider. It's all CSS in the background, you can customize the hell out of it.

Setting the snap you can do increments and update the amount like this:

$("#mySlider").slider({
      orientation: "vertical",
      range: "min",
      min: 0,
      max: 100,
      step: 5,
      slide: function(event, ui) {
           $("#amount").val(ui.value);
      }
 });
$("#amount").val($("#mySlider").slider("value"));
like image 167
Nick Craver Avatar answered Oct 11 '22 14:10

Nick Craver