JQuery will change color on click handle

I use the jquery knob on my site to create nice visual effects. I want to change color using click event. I have provided a simplified script of what I am trying to achieve. I tried a few hours and now I have to ask for help

DEMO http://jsfiddle.net/JW2gP/62/

HTML

<input type='text' id='dial' value='0' />

<a id="chgColor" href="#">Change color on click</a>

JQuery

$(function () {
    $('#dial').knob({
        min: '0',
        max: '25000',
        fgColor: '#f00'
    });
    $('#dial').val(10927).trigger('change');
});

$('#chgColor').click(function(e){
    e.preventDefault();
    $('#dial').knob({
        min: '0',
        max: '25000',
        fgColor: '#000'
    }); 
});
+3
source share
1 answer

VIOLA (and here, in the violin, I finally found my reviews: http://jsfiddle.net/bhilleli/JW2gP/66/ )

$(function () {
    $('#dial').knob({
       min: '0',
       max: '25000',
       fgColor: '#f00'
    });
    $('#dial').val(10927).trigger('change');
});

$('#chgColor').click(function(e){
   e.preventDefault();

   $('#dial').trigger(
     'configure',
      {
        min: '0',
        max: '25000',
        "fgColor":"#001"
    }
);
});
+6
source

All Articles