admin管理员组文章数量:1024581
I am using jquery knob knob on my site to create some nice visuals. I wish to change the color using a click event. I have provided a simplified fiddle of what I am trying to achieve. I have been trying for several hours and now have to ask for help
DEMO /
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'
});
});
I am using jquery knob knob on my site to create some nice visuals. I wish to change the color using a click event. I have provided a simplified fiddle of what I am trying to achieve. I have been trying for several hours and now have to ask for help
DEMO http://jsfiddle/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'
});
});
Share
Improve this question
asked Feb 21, 2014 at 22:57
user1320260user1320260
1
- 1 What is it exactly what you want to do? The left part of the circle changes when I click it. Or do you want other functionality? – user2609980 Commented Feb 21, 2014 at 23:11
1 Answer
Reset to default 6VIOLA (and here in fiddle, finally found my creds: http://jsfiddle/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"
}
);
});
I am using jquery knob knob on my site to create some nice visuals. I wish to change the color using a click event. I have provided a simplified fiddle of what I am trying to achieve. I have been trying for several hours and now have to ask for help
DEMO /
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'
});
});
I am using jquery knob knob on my site to create some nice visuals. I wish to change the color using a click event. I have provided a simplified fiddle of what I am trying to achieve. I have been trying for several hours and now have to ask for help
DEMO http://jsfiddle/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'
});
});
Share
Improve this question
asked Feb 21, 2014 at 22:57
user1320260user1320260
1
- 1 What is it exactly what you want to do? The left part of the circle changes when I click it. Or do you want other functionality? – user2609980 Commented Feb 21, 2014 at 23:11
1 Answer
Reset to default 6VIOLA (and here in fiddle, finally found my creds: http://jsfiddle/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"
}
);
});
本文标签: javascriptJquery change color on clickknob knobStack Overflow
版权声明:本文标题:javascript - Jquery change color on click - knob knob - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745622219a2159643.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论