使用键盘覆盖文本框

时间:2016-01-29 14:37:10

标签: javascript jquery html5 cordova mobility

我在我的html5应用程序中使用了cordova。现在每当我按下文本框时,键盘就会出现,但是这个键盘覆盖了文本框,我的屏幕也没有移动到顶部。

但有趣的是,此问题仅在安装后发生一次。每当我点击文本框键盘时,第二次开始正在显示,屏幕将移至顶部

我正在使用焦点和模糊事件,如下面的

this.$('#event').on('blur', function() {    
    $('#event').css('height', $(window).height());              
    cordova.plugins.Keyboard.disableScroll(false);
});
this.$('#event').on('focus', function() {   
    $('#event').css('height', $(window).height());          
    cordova.plugins.Keyboard.disableScroll(false);
});

0 个答案:

没有答案