jQuery-mobile,Phonegap,iOS,固定标题在离开输入表单后跳转

use*_*555 5 ios jquery-mobile cordova

我在iOS上将Phonegap与JQuery-mobile和Phonegap一起使用。我在离开表单输入时标题跳到中间时遇到了这个问题。

我已经在固定的页眉和页脚上设置了data-hide-during-focus =“ true”。这个问题使我丧命。

Ami*_*ati 3

如果我们只有一个标题栏,那么我们只能遵循主标题栏的代码。

\n\n
    $(document).on(\'focus\', \'select, input, textarea\', function () {\n        $(\'#main-headerbar\').css({\'position\': \'absolute\', \'top\': \'0px\' });\n    });\n    $(document).on(\'blur\', \'select, input, textarea\', function () {\n        $(\'#main-headerbar\').css({ \'position\': \'fixed\' });\n    });\n
Run Code Online (Sandbox Code Playgroud)\n\n

如果我们有两个标题栏,第二个标题栏将显示在主标题栏下方(如果 main-headerbar\xe2\x80\x99s 高度为 \xe2\x80\x9947px\xe2\x80\x99,则设置第二个标题栏的顶部样式-标题栏,顶部:47px)。

\n\n
$(document).on(\'focus\', \'select, input, textarea\', function () {\n    $(\'#main-headerbar\').css({\'position\': \'absolute\', \'top\': \'0px\' });\n    $(\'#Second-headerbar\').css({ \'position\': \'absolute\', \'top\' : \'0px\' });\n});\n$(document).on(\'blur\', \'select, input, textarea\', function () {\n    $(\'#main-headerbar\').css({ \'position\': \'fixed\' });\n    $(\'#Second-headerbar\').css({ \'position\': \'fixed\', \'top\': \'47px\' });\n});\n
Run Code Online (Sandbox Code Playgroud)\n\n

或者按照 iOS 修复输入上的位置固定元素

\n