正在使用 jquery Mobile 创建一个phonegap 应用程序。在我的应用程序中,固定输入字段出现在虚拟键盘的顶部,这在 android 中工作正常,但在 IOS 中,当虚拟键盘出现时它不起作用。
我的问题比这个小IOS 修复了虚拟键盘上的页脚工具栏中断问题 https://stackoverflow.com/questions/24557780/ios-7-fixed-footer-toolbar-breaks-on-virtual-keyboard
js
header_height = $('.main-header').height();
footer_height = $('.footer').height();
footer_input_height = $('.fixed_bottom').height();
$('.fixed_bottom').css('bottom',footer_height+'px');
$('#messages .ui-panel-wrapper').css('padding-bottom','inherit');
$("input, textarea").blur(function() {
$("[data-role=footer]").show('','',function(){
$('#messages').css('padding-bottom',footer_height+'px');
$('#messages .ui-panel-wrapper').css('padding-bottom','inherit');
$('.fixed_bottom').css('bottom',footer_height+'px');
});
});
$("input, textarea").focus(function() {
$("[data-role=footer]").hide('','',function(){
$('#messages').css('padding-bottom','0px');
$('#messages .ui-panel-wrapper').css('padding-bottom','0px');
$('.fixed_bottom').css('bottom','0px');
});
})
CSS
#messages .fixed {
left: 0;
right: 0;
width: 100%;
position: fixed;
z-index: 1000;
display: block;
}
#messages .fixed_bottom {
bottom: 0px;
}
screenshot in android
screenshoot in Iphone