STYLE SWITCHER

jquery ui slider display values

$(function() {
   var labelArr = new Array("", "1 hour", "12 hours", "1 day", "3 day", "1 week");
   $( "#slider" ).slider({
       value:3,
       min: 1,
       max: 5,
       step: 1,
       slide: function( event, ui ) {
          $( "#days" ).val( ui.value );
          $("#label").html(labelArr[ui.value]);
       }
   });
   $( "#days" ).val($( "#slider" ).slider( "value" ) );
   $("#label").html(labelArr[$( "#slider" ).slider( "value" )]);
});​

Recent Article

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Keep your skills sharp, get informed.

    Subscribe to our mailing list and get interesting stuff and updates to your email inbox