【apicloud】沉浸式解决方案

apicloud论坛发现的沉浸式解决方案,适配各种手机,收藏一波。 感谢筦陶

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../css/commom.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../icon/iconfont.css"/>
</head>
<style type="text/css">
        .mui-bar{
                background-color: #fff;
        }
        .mui-bar .mui-title{
                color: #333;
        }
        .mui-action-back{
                color: #FFFFFF;
        }
</style>
<body>
        <div class="all" id="app">
                <header class="header mui-bar mui-bar-nav">
                    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
                    <h1 class="mui-title">标题</h1>
                </header>
                <div class="main"></div>
        </div>
        <script src="../../js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/api.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/common.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/vue.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
        var apiready = function(){
                                var vm =new Vue({
                                        el:'#app',
                                        data:{},
                                        methods:{},
                                        created:function(){},
                                        mounted:function(){
                                                immersion();
                                                
                                        }
                                })
                        }
function immersion() {
        if(api.statusBarAppearance) {
                var $header = $('.header');
                var height = $header.innerHeight();
                var safeArea = api.safeArea.top;
                height += safeArea;
                $header.css('height', height);
                $('.main').css('margin-top', height);
                $api.fixStatusBar($header[0]);
        }

}


        </script>
</body>
</html>


白俊遥博客
请先登录后发表评论
  • 最新评论
  • 总共0条评论
  • © 2017-2018 iskeys.com 版权所有 ICP证:闽ICP备16003513号-1
  • 联系邮箱:c383542045@qq.com