You cannot directly change the setting to do this if you want to save 1 and 5 on the slider. If you need only 2,3 and 4, you can use:
$( ".selector" ).slider({ min: 2, max: 4 });
If you want to keep 1 and 5, you will need to write an onChange function. Similar to:
$( ".selector" ).slider({ change: function(event, ui) { this.value == 1? this.value = 2: this.value;
Not sure if this is the correct syntax, you will need to check.
source share