Questions tagged [jquery-knob]

An jQuery-based spinner/dial control.

jQuery Knob canvas based ; no png or jpg sprites. touch, mouse and mousewheel, keyboard events implemented. downward compatible ; overloads an input element.

Useful links:

Example

<input type="text" value="75" class="dial">

$(function() {
    $(".dial").knob();
}

enter image description here

Options

Options are provided as attributes 'data-option':

<input type="text" class="dial" data-min="-50" data-max="50">

... or in the "knob()" call :

$(".dial").knob({
                'min':-50
                ,'max':50
                })

The following options are supported :

  • Behaviors :

    • min : min value | default=0.
    • max : max value | default=100.
    • angleOffset : starting angle in degrees | default=0.
    • angleArc : arc size in degrees | default=360.
    • stopper : stop at min & max on keydown/mousewheel | default=true.
    • readOnly : disable input and events | default=false.

  • UI :
    • cursor : display mode "cursor" | default=gauge.
    • thickness : gauge thickness.
    • width : dial width.
    • displayInput : default=true | false=hide input.
    • displayPrevious : default=false | true=displays the previous value with transparency.
    • fgColor : foreground color.
    • bgColor : background color.

  • Hooks

    $(".dial").knob({ 'release' : function (v) { /make something/ } });

  • 'release' : executed on release

    Parameters :

    value : int, current value


- 'change' : executed at each change of the value
Parameters :

value : int, current value
'draw' : when drawing the canvas


The scope (this) of each hook function is the current Knob instance (refer to the demo code).

Example

<input type="text" value="75" class="dial">

<script>
$(".dial").knob({
                 'change' : function (v) { console.log(v); }
                });
</script>

Dynamically configure

<script>
$('.dial')
    .trigger(
        'configure',
        {
        "min":10,
        "max":40,
        "fgColor":"#FF0000",
        "skin":"tron",
        "cursor":true
        }
    );
</script>

Set the value

<script>
$('.dial')
    .val(27)
    .trigger('change');
</script>

Supported browser Tested on Chrome, Safari, Firefox, IE 9.0.

145 questions
0
votes
0 answers

Problems using jquery.knob dynamically

I dynamically load JS - files: $(document).ready(function () { $.when( $.getScript("./setup/js/jquery.knob.js"), $.Deferred(function (deferred) { $(deferred.resolve); }) ).done(function () { …
Ole Albers
  • 8,715
  • 10
  • 73
  • 166
0
votes
1 answer

No change in the filling colored knob jquery

I plugged in the form of a knob jquery in this way:
Dave Pate
  • 39
  • 1
  • 6
0
votes
1 answer

jQuery Knob Release function additional parameter

I'm using the jQuery Knob plugin https://github.com/aterrien/jQuery-Knob Now, I've got the following jQuery Knob Initialization loop
Maaz
  • 4,193
  • 6
  • 32
  • 50
0
votes
1 answer

jQuery knob animate - how to stop going all the way to maximum value

I have the following code which works great - however I need the animation to stop at the value, not the max value. At present it goes all the way to max value and does not stop at the value of the knob. Any…
Jeremy
  • 327
  • 1
  • 7
  • 17
0
votes
2 answers

jQuery Knob use a image instead / to cover the value

do you know if it is possible to replace, cover o insert an image inside the circular progress bar? I know that the value can be omitted, but no example or tip if can be replaced.
raulricardo21
  • 2,499
  • 4
  • 20
  • 27
0
votes
3 answers

Knob - Fit text inside circle

I'm trying to fit the text inside the circle, in paticulary I'm trying to add some labels such as Hour, Minutes,.. However I can't fit the text inside the circle; at this moment I'm using this inside the draw function: $('body').append('
Razorphyn
  • 1,314
  • 13
  • 37
0
votes
1 answer

JQuery Knob plugin - animate the values rising on read only knobs? - Canvas

Here's a JSFiddle of the JQ Knob plugin which allows us to create dynamic stat wheels ("knobs") The knob inputs are pretty basic:
user2700923
0
votes
1 answer

jQuery Knob hover animation

I want to animate the Knob circle that it fills up on hovering. I'm new to Knob so i have no idea where my error is or if i even have the right direction. Right now it does not even show a circle :( Basically i just want to have a circle around an…
Chris
  • 2,069
  • 3
  • 22
  • 27
0
votes
1 answer

How to label Knob within the canvas

I would like to know how to include a text also inside the value field provided in the knob.js plugin. https://github.com/aterrien/jQuery-Knob I did not come across a parameter where I can include text field also inside the value. If there is a work…
user2409375
  • 115
  • 1
  • 12
0
votes
1 answer

Run function on jquery knob release

I have a form that calculates an estimate. I want the sales person to be able to mark up the estimate, by a percentage using jquery-knob. I have it all working, but I want to have the value change on release of the knob, or change for that matter,…
jkuhns5
  • 96
  • 12
0
votes
1 answer

Knob.js to move on mouse scroll

Hello and thank you for your time. I was hoping that someone has already run into this issues and solved it. I am trying to make the knob.js to move up and down as you scroll on the website and not have to be over the knob for it to move. Help is…
0
votes
4 answers

Adjust jQuery knob size dynamically to the layout

I'm using jQuery Knob for displaying progress (read only mode). I want the circle size to adjust to the size of the layout / device my app is used on dynamically. I already tried to use data-width="75%" but the circle disappears. My second try was…
ManuKaracho
  • 1,180
  • 1
  • 14
  • 32
0
votes
2 answers

jquery knob cursor width in percentage

i am using jquery knob and in my use case I want the cursor width in percentage so that when the width is 100% cursor occupies the whole circle, however it only takes numeric value as input, what are my options ? $(function() { …
Dev R
  • 1,892
  • 1
  • 25
  • 38
0
votes
1 answer

Jquery Knob not working in IE 8

Iam using jquery knob in my website. it works fine in mozilla ,crome and safari. but not working in ie8. This is my ie result :(.