jqmobi. on ios (ipod) when input field focused content moves up

醉酒当歌 提交于 2019-12-25 03:06:36

问题


I'm using jqmobi. http://jqmobi.com/testdrive - same here

On iOS when the input field becomes focused, the content moves up. I want the header to stay in the same position.


回答1:


There no method to do it in the current jqMobi version. A Workaround is to reposition #jQUi style.top according to the document.body.scrollTop when the phone enters keyboard mode;

You can use $.touchLayer event 'enter-edit-reshape' and 'exit-edit-reshape' to detect the resize cross-browser.

$.bind($.touchLayer, 'enter-edit-reshape', function(){
    $('#jQUi').css('top', document.body.scrollTop+'px');
});
$.bind($.touchLayer, 'exit-edit-reshape', function(){
    $('#jQUi').css('top', 0);
});

Cheers! :)



来源:https://stackoverflow.com/questions/12250620/jqmobi-on-ios-ipod-when-input-field-focused-content-moves-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!