【问题标题】:How to move Virtual Keyboard on top of input field?如何在输入字段顶部移动虚拟键盘?
【发布时间】:2017-07-28 15:10:28
【问题描述】:

我使用了 jquery 虚拟键盘,我想在文本字段的顶部显示键盘。我已经尝试通过位置设置。

JQuery

$('#test').keyboard({ layout: 'qwerty', usePreview: false,position: {
        // null = attach to input/textarea;
        // use $(sel) to attach elsewhere
        of: null,
        my: 'left top',
        at: 'left top',
        // used when "usePreview" is false
        at2: 'left top'
} });

HTML

<p style="height:200px" >
content
</p>
<input type="text" class="form-control" id="test" placeholder="test" autocomplete="off">

这里是演示网址http://jsfiddle.net/bhumi/rzrjw15h/1/。

我也尝试过设置位置

position : {
            of : '#searchterms',        // when null, element will default to kb.$keyboard
            my : 'top', // 'center top', (position under keyboard)
            at : 'top-200',  // 'center bottom',

        }

【问题讨论】:

    标签: javascript jquery html css keyboard


    【解决方案1】:

    见jsfiddle

    $('#test').keyboard({ layout: 'qwerty', usePreview: false,
      position: {
        my: 'center bottom',
        at: 'center bottom',
        // used when "usePreview" is false
        at2: 'center top'
      }
    });
    

    【讨论】:

      【解决方案2】:

      Working Fiddle

      试试:

      $('#test').keyboard({
        layout: 'qwerty',
        usePreview: false,
        position: {
          of: null,
          at2: 'top-100'
        }
      });
      

      【讨论】:

      • 输入字段从顶部的位置是动态的,更改时不起作用
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-15
      • 1970-01-01
      相关资源
      最近更新 更多