local $this
object was not getting set for every new instance of knob,instead same this
object was referenced each time.
so what you need to do is create a new local reference of this
object for every knob instance.
var $this = $(this);
JS CODE:
$('.knob').each(function() {
var $this = $(this);
var myVal = $this.attr("rel");
$this.knob({
});
$({
value: 0
}).animate({
value: myVal
}, {
duration: 2000,
easing: 'swing',
step: function() {
$this.val(Math.ceil(this.value)).trigger('change');
}
});
});