我在iOS上使用Phonegap和JQuery-mobile,Phonegap。我在离开表单输入时遇到了跳转到中间的问题。
我已经在固定的页眉和页脚上设置了数据隐藏 - 焦点=“真”。这个问题让我很难过。
答案 0 :(得分:2)
如果我们只有一个标题栏,那么我们只能遵循主标题栏的代码。
$(document).on('focus', 'select, input, textarea', function () {
$('#main-headerbar').css({'position': 'absolute', 'top': '0px' });
});
$(document).on('blur', 'select, input, textarea', function () {
$('#main-headerbar').css({ 'position': 'fixed' });
});
如果我们有两个标题栏,则第二个标题栏将显示在主标题栏下方(如果主标题栏的高度为'47px',则为第二个标题栏设置顶部样式,顶部:47px)。
$(document).on('focus', 'select, input, textarea', function () {
$('#main-headerbar').css({'position': 'absolute', 'top': '0px' });
$('#Second-headerbar').css({ 'position': 'absolute', 'top' : '0px' });
});
$(document).on('blur', 'select, input, textarea', function () {
$('#main-headerbar').css({ 'position': 'fixed' });
$('#Second-headerbar').css({ 'position': 'fixed', 'top': '47px' });
});
答案 1 :(得分:0)
我有类似的问题,我使用的是1.0.1,主要问题是标题跳转出现在旧的2.3版本的android甚至在谷歌Nexus手机中。我搜索互联网的次数超过了一些R& D我意识到这基本上是css的错误以下我已经做了解决它
.header{ border: 0px; position: fixed; width: 100%; top: 0px; left: 0px; z-index: 21; }
此外,如果您在更改页面后遇到标题跳转的任何问题,请添加此代码
$.mobile.silentScroll(0);
$("#yournextpageid").live("pageshow", function() { $.mobile.silentScroll(0); }
Jquery data-position="fixed"
的作用是动态地将顶部位置添加到其标题中,并且它具有开销并且在某些设备中证明非常粘。此外,它在打开键盘时跳入某些设备。添加上面的CSS将解决您的问题。
答案 2 :(得分:-1)
将该行更改为false它将解决您的问题..