Reputation: 207
Is there a way to add plus sign "+" for positive values with jQuery ui-slider? By default the negative sign shows but I want the positive sign as well to show the difference from starting value.
Upvotes: 0
Views: 632
Reputation: 5224
I reckon you have already figured out the solution for it. If not here is the answer.
You can use the slide
and create
events for manipulating these values in Slider ,
create : function() {
//For initialization event
var value=$(".slider").slider( "value" );
$("#amount").val((value > '0') ? ('+'+ value) : value);
},
slide: function (event, ui) {
//Slide Event
$("#amount").val((ui.value > '0') ? ('+'+ ui.value) : ui.value);
}
Upvotes: 1