我使用的是jqmobi。http://jqmobi.com/testdrive -与此相同
在iOS上,当输入字段成为焦点时,内容会向上移动。我希望头部保持在相同的位置。
发布于 2012-10-05 00:24:54
在当前的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);
});干杯!:)
https://stackoverflow.com/questions/12250620
复制相似问题