ios的虚拟键盘与fixed移动端的bug

//$('#search')表单input;$('.search_out')浮动元素


var u = navigator.userAgent, app = navigator.appVersion;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if (isiOS) {
$('#search').focus(function (e) {
if(!window.res) {
setTimeout(function(){var height = $(window).scrollTop();
$('.search_out').css({position:"absolute",top: -height+"px"})},10)
}
});
$('#search').blur(function () {
if(!window.res) {
$('.search_out').css({position:"fixed",top:"0px"});
}
});
};

http://www.cnblogs.com/yexiaochai/p/3561939.html 参考叶大神的讲解!

posted @ 2015-10-08 18:05  me春天  阅读(234)  评论(0编辑  收藏  举报