0

我正在使用jqmobi。 http://jqmobi.com/testdrive - 这里也一样

在 iOS 上,当输入字段变为焦点时,内容会向上移动。我希望标题保持在同一位置。

4

1 回答 1

0

在当前的 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);
});

干杯! :)

于 2012-10-04T16:24:54.113 回答