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


source to share





All Articles