Reputation: 5460
I am using Knob JS and need to change the dial value and also the maximum value.
Knob is implemented as:
<input class="dial" data-max="30" data-width="225" data-height="225">
And I change the value dynamically using:
<script>
function changeknobval(val){
$('.dial')
.val(val)
.trigger('change');
}
$(document).ready(
function() { changeknobval(26); });
</script>
Changing Knob value is working fine but I am lost at how to change the maximum range value. In Git repo I see this in jquery.knob.js :
this.o = $.extend(
{
// Config
min : this.$.data('min') !== undefined ? this.$.data('min') : 0,
max : this.$.data('max') !== undefined ? this.$.data('max') : 100,
...
Could someone please educate me how I can change the max value?
Cheers.
Upvotes: 0
Views: 5381
Reputation: 227270
According to the docs (https://github.com/aterrien/jQuery-Knob#dynamically-configure), you can do:
$('.dial').trigger('configure', {
max: 200
});
Upvotes: 2