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
1
vote
0 answers

jQuery Knob with persistent current value when dragging to new value (show both)

I am building a gauge/knob for a climate control UI. I would like to show the current temperature, and allow the user to drag/click to a new value, while keeping the current (old) value visible. I've googled this for days and can't seem to find a…
1
vote
0 answers

jquery knob updating by javascript from a webservice

I want to use the jquery knob to show values parsed from a webservice, updating every 1 seceond. In the code below, the webservice url will return 60 (tested ok) but I cant figure out how to update the knob. (I have the script for drawing the knob…
user1546642
  • 19
  • 1
  • 6
1
vote
1 answer

Knob.js - Is there a way to link up dials so that they have a combined total?

I'm using the latest jQuery Knob.js and wondered if there is a way to link up 3 dials so that each value changes on "change" in order for the combined total to never go over 100%? Initially all 3 dials are set to 33%. if a user changes one of the…
1
vote
2 answers

jQuery Knob, Submit only on last change/release

I am using jQuery Knob by anthonyterrien with step set to 20. I want to submit the value of the knob to the server. Problem is that change functions is called every time the user moves the knob using right click or left click(release is called only…
1
vote
1 answer

jquery knob responsive resize doesn't work in resizable bootstrap panel

I am trying to have a jQuery knob widget within a bootstrap panel to be resized automatically when panel itself gets resized (thanks to jQuery UI resizable). HTML:
mguijarr
  • 7,641
  • 6
  • 45
  • 72
1
vote
1 answer

Avoiding the $watch() loops that result in $digest already in progress errors

This question is related to a previous question which is no longer looked at because it has an upvoted answer: Change jQuery Knob Min/Max value The following code is a wrapper for the jQuery knob plugin. I am aware of existing angular wrappers, but…
AaronF
  • 2,841
  • 3
  • 22
  • 32
1
vote
1 answer

Knob show buttons in the center

I'm using jQuery Knobs to create a few control elments and so far it is working great. Now i d like to have two buttons in the center of the knob. To create the button i would use something like this:
1
vote
1 answer

jQuery Knob partially read only

I have a collection of jQuery knobs on my page that represent percentages. Each knob can have a value from 0-100, however, each subsequent knob should not have a value less than the previous knob. Essentially I want to make part of the knob read…
Jared Knipp
  • 5,880
  • 7
  • 44
  • 52
1
vote
1 answer

dynamically create Jquery Knob from Slidr menu

I'm working on a synth-like program in the browser using web audio. This may sound stupid, but I can't seem to get the button to create the knob when it's clicked. I've tried setting up the knob in a few different ways including, adding the data-…
ryanhagz
  • 193
  • 1
  • 2
  • 15
1
vote
2 answers

jQuery knob broken using Foundation 5

Good day. I'm trying to use Anthony Terrien's jquery Knob with Zurb Foundation but it seems like the text input is broken. Here is a screenshot: https://i.stack.imgur.com/3fRB7.png As you can see, the input[type="text"] is in the lower left part of…
1
vote
1 answer

adding jQuery.knob dynamically

I have to dynamically generate HTML-Code that uses jKnob. This code does work:
Ole Albers
  • 8,715
  • 10
  • 73
  • 166
1
vote
2 answers

Overriding units on a jQuery Knob does not redraw correctly on page reload

I have a readonly jQuery Knob. I have been able to add units to the numeric display (as per How to display units with Jquery Knob ), but the foreground (ie. graphical value indicator) of the dial is no longer displayed when the page is…
winwaed
  • 7,645
  • 6
  • 36
  • 81
1
vote
2 answers

jQuery knob, put image instead of text

I'm using jQuery Knob and I'm wondering is there any way to put an image inside of knob instead of text, if not are there any other plugins similar to jQuery Knob which have this feature?
hyperN
  • 2,674
  • 9
  • 54
  • 92
1
vote
1 answer

jQuery Knob update value with animate

I'm trying to build clock using jQuery Knob. My clock is working (http://jsfiddle.net/Misiu/9Whck/1/), but right now I'm trying to add some extras to it. At beginning I want to have all knobs set to 0, then using animate I want to animate their…
Misiu
  • 4,738
  • 21
  • 94
  • 198
1
vote
1 answer

jquery knob animate on load section

I'm using jquery.knob plugin in a website is very easy to implement. I animate it and everything is ok, but i would like animate effect start when I scroll to specific section of the web: for example when I scroll to #about section. Anybody Knows if…
Trenton
  • 49
  • 12