Skip to content

updateRange was insufficient, added an updateScale #64

@samcov

Description

@samcov

In the demo, if you update the range => $('.range-slider').jRange('updateRange', '0,200');
Then you can call updateScale => $('.range-slider').jRange('updateScale',[0,50,100,150,200]);
Code in jquery.range.js shown below.

updateScale: function(scale, from, to) {
var s = scale || [from, to];
var prc = Math.round((100 / (s.length - 1)) * 10) / 10;
var str = '';
for (var i = 0; i < s.length; i++) {
str += '' + (s[i] != '|' ? '' + s[i] + '' : '') + '';
}
this.scale.html(str);

$('ins', this.scale).each(function() {
	$(this).css({
		marginLeft: -$(this).outerWidth() / 2
	});
});

},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions