返回列表

部分微信在iphone5s下会出现可视区域高度超出问题

默认分类 2014/10/20 22:07

部分微信在iphone5s下会出现可视区域高度超出问题。 具体表现为:height:100%;底部会截掉一部分;实际高度568px;只显示504px 解决方案:在window.onresize时重绘页面,或判断是否是568px,是则强制显示成504px

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>kkk</title>

    <style type="text/css">
        html,
        body {
            width: 90%;
            height: 100%;
            margin: 0;
            padding: 0;
            background: #fff;
            box-sizing: border-box;
            -webkit-user-select: none;
            color: orange;
            border: 3px solid green;
        }

    </style>
    <script type="text/javascript">
    window.onresize = function(){
        document.getElementById('aa').innerHTML += ' ===' + document.body.offsetHeight;
    }</script>
</head>
<body>
    <span id="aa" style="width:300px;display:inline-block;">aa</span>

</body>
</html>