Skip to content

not a issue but easy way to get in contact with #365

Closed

Description

@xpectmore
using your plugin in this way can improve mobile input number form

<div class="py-5 text-center pi-draggable" draggable="true">
    <div class="container">
      <div class="row">
        <div class="col-md-4">
          <input type="text" class="  " data-cursor="true" value="56" onfocus="thisknob(this);">
        </div>
        <div class="col-md-4">
          <input type="text" class="  " data-cursor="true" value="56" onfocus="thisknob(this);">
        </div>
        <div class="col-md-4">
          <input type="text" class="  " data-cursor="true" value="56" onfocus="thisknob(this);">
        </div>
      </div>
    </div>
  </div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"> </script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jQuery-Knob/1.2.13/jquery.knob.min.js"> </script> <script>
    var current = null;

    function thisknob(what) {
      target = what;
      if (current != null) resetknob();
      current = $(what).knob({
        min: 0,
        max: 300,
        stopper: true,
        'release': function(v) {
          // console.log('da');
          resetknob();
        }
      });
    }

    function resetknob() {
      value0 = $(current[0]).find('input')[0].value;
      //console.log($(current[0]));
      $(current[0]).parent().html('<input type="text" class="  " data-cursor="true" value="' + value0 + '" onfocus="thisknob(this);" >');
      current = null;
    }
  </script>

ONCE you install this in a html and you open on mobile try to edit then try to edit another element

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions