0

i'm currently looking for an solution to change the size of my Jquery Knob Chart when the user resize the browser. Till now i only found a solution : reload the site on Resize and check Browser width and set the height and width based on this. But this won't work correctly on Smartphones. Maybe you have an idea?

Omar
  • 32,302
  • 9
  • 69
  • 112
xNiceEinz
  • 53
  • 10
  • 1
    Are you using jquery knob slider or anyother chart control ? Can you update any screenshot or jsfiddle with your tryout.. – Soundar Jan 20 '16 at 11:48
  • Its not that easy so there is no chance to do this. - It is Knob Slider But i thought about it and if im right i just need a function which proof if size before is greater than "var a" and at first time when i resize and is smaller than "var a" it should reload the page but only one time not on every resize :x any idea? @SoundarR – xNiceEinz Jan 21 '16 at 07:36
  • 1
    Are you using [jQuery knob](http://anthonyterrien.com/knob/), i don't think whether it supports responsive since this is a canvas element.. Have you tried [jQuery roundSlider](http://roundsliderui.com), which supports responsive modes... – Soundar Jan 21 '16 at 09:02
  • I'm using the first one. I have the problem there are 3 Knobs overlayed. it looks like [this](http://imgur.com/ORBBipN) @SoundarR – xNiceEinz Jan 21 '16 at 10:20

1 Answers1

1

Haven't tested this on a smartphone, but to make a knob responsive, you should add data-width attribute to its element.

An example:

<input class="knob" data-width="50%" value="35">

You can find another example in jQuery Knob's github.

Harry
  • 181
  • 5
  • 13
  • @xNiceEinz if this solution answered your question, please accept it. If not, maybe I can give some other example or further help? – Harry Mar 15 '16 at 13:13