You should define your actual range in your slider options:
$("#slider").slider({
range: "min",
value: 0,
min: 0,
max: 140000,
step: 20000
})
Then use the step
option as your increment in the loop:
for (var i = 0; i <= vals; i += opt.step) {...}
Here's a demo fiddle
And the resulting code:
$("#slider").slider({
range: "min",
value: 0,
min: 0,
max: 140000,
step: 20000
}).each(function () {
//
// Add labels to slider
//
// Get the options for this slider
var opt = $(this).data().uiSlider.options;
// Get the number of possible values
var vals = opt.max - opt.min;
// Space out values
for (var i = 0; i <= vals; i += opt.step) {
var el = $('<label>' + i + '</label>').css('left', (i / vals * 100) + '%');
$("#slider").append(el);
}
});