移动Safari iOS 6.0固定定位而键盘显示 [英] Mobile Safari iOS 6.0 fixed positioning while keyboard showing

查看:170
本文介绍了移动Safari iOS 6.0固定定位而键盘显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您将固定位置div设置为屏幕底部,则在显示虚拟键盘时,此div不会停留在底部。它将随着页面的高度增加而向上移动。这个问题不会发生在iOS 5中,因为div继续保持在底部,就像它应该。任何帮助?

If you have a fixed position div set to the bottom of the screen, this div does not stay at the bottom while the virtual keyboard is shown. It would move up as the height of the page increases. This problem does not occur in iOS 5 as the div continues to stay at the bottom like it should. Any help?

推荐答案

在键盘活动时,您可以隐藏固定的div吗?

Could you simply hide the fixed div while the keyboard is active?

$("#text_field").focus(function(){
  $("#fixed_div").hide();
});


$("#text_field").blur(function(){
  $("#fixed_div").show();
});

这篇关于移动Safari iOS 6.0固定定位而键盘显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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