JQuery Handle not firing on event

I just want to trigger an event like a release or change event with a jQuery handle. According to the documentation , it should work with this:

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

      

There is something very similar in my code:

<html>
  <head>
    <meta charset="utf-8">
    <link rel="icon" href="img/favicon.png">
    <title>Knobs</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="js/text.js"></script>
    <script type="text/javascript" src="js/jquery.knob.min.js"></script>
  </head>
  <body>
<div class="knobBar">
      <input id="gain1" class="knob"
        data-angleOffset=-125
        data-angleArc=250
        data-bgColor="#262626"
        data-fgColor="#00ff00"
        data-rotation="clockwise"
        value="0"
        data-min="0"
        data-max="100"
        data-lineCap="round"
        data-displayPrevious="true"
        data-width="5%"
        data-font="Advanced LED Board-7">
</body>

      

And I put this at the end of the html file:

<script>
//Listeners for Knobs changes
$(function () {
  $('#gain1').knob({
      'release': function (v) {
    console.log(v);
    gain_1.gain.value = v / 100;
  }});
  }) 
</script>

      

I just don't work. It doesn't print anything to the console, so obviously the function doesn't run.

+3
javascript jquery html


source to share


No one has answered this question yet

Check out similar questions:

7428
How can I check if an element is hidden in jQuery?
4523
Thinking in AngularJS if I have a jQuery background?
4345
How to check if a checkbox is checked in jQuery?
3952
Setting "checked" for a checkbox with jQuery?
2644
Is there a function "exists" for jQuery?
2414
How can I find out which radio button is selected using jQuery?
2302
Add table row in jQuery
2245
How do I refresh the page using jQuery?
2101
jQuery scroll to element
1957
Disable / enable input with jQuery?



All Articles
Loading...
X
Show
Funny
Dev
Pics