jqmobi。当输入的以字段为中心的内容向上移动时,在ios(ipod)上 [英] jqmobi. on ios (ipod) when input field focused content moves up

查看:142
本文介绍了jqmobi。当输入的以字段为中心的内容向上移动时,在ios(ipod)上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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

推荐答案

在当前的jqMobi版本中没有方法可以做到这一点。
一种解决方法是在手机进入键盘模式时根据document.body.scrollTop重新定位#jQUi style.top;

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;

你可以使用$ .touchLayer事件'enter-edit-reshape'和'exit-edit-reshape'检测调整大小的跨浏览器。

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);
});

干杯! :)

这篇关于jqmobi。当输入的以字段为中心的内容向上移动时,在ios(ipod)上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆