<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta http-equiv="Access-Control-Allow-Origin" content="*" />
<meta name="format-detection" content="telephone=no" />
<title>测试</title>
<script src="/assets/p-default/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
<style>
*{margin:0;padding:0}
html,body{width:100%;height:100%;}
.con{
height: 100%;
background: url('/assets/p-default/images/wxpublic/bg.jpg') no-repeat left top;
background-size: 100% 100%;
}
.writeidprompt{margin-top:-500px;}
</style>
</head>
<body>
<div class="con">
</div>
<div class="writeidprompt">
<input type="text" name="" class="userid" value="" />
</div>
</body>
</html>
<script type="text/javascript">
$(function(){
$('.userid').focus(function(){
a = $(window).height();
$('.con').css('height',a + 'px');
})
})
</script>
这样就不会被顶上去了
参考:https://blog.csdn.net/weixin_42301940/article/details/80524323