我正在使用 jqmobi。 http://jqmobi.com/testdrive - 这里也一样
在 iOS 上,当输入字段获得焦点时,内容会向上移动。我希望页眉保持在同一位置。
最佳答案
在当前的 jqMobi 版本中没有方法可以做到这一点。 解决方法是在手机进入键盘模式时根据 document.body.scrollTop 重新定位#jQUi style.top;
您可以使用 $.touchLayer 事件 'enter-edit-reshape' 和 'exit-edit-reshape' 来检测跨浏览器的调整大小。
$.bind($.touchLayer, 'enter-edit-reshape', function(){
$('#jQUi').css('top', document.body.scrollTop+'px');
});
$.bind($.touchLayer, 'exit-edit-reshape', function(){
$('#jQUi').css('top', 0);
});
干杯! :)
关于css - jqmobi。在 ios (ipod) 上,当输入字段聚焦的内容向上移动时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12250620/