wap.html 1.36 KB
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <title>YOHO大数据平台</title>
    <script src="https://cdn.yoho.cn/lib/babel-polyfill-6.23.0.js"></script>
    <meta>
    <script>
        (function(win) {
            var doc = win.document;
            var docEl = doc.documentElement;
            var tid;

            function refreshRem() {
                var width = docEl.getBoundingClientRect().width;
                if (width > 750) {
                    docEl.style.fontSize = '20px';
                } else {
                    var rem = 40 * width / 750;
                    docEl.style.fontSize = rem + 'px';
                }                
            }

            win.addEventListener('resize', function() {
                clearTimeout(tid);
                tid = setTimeout(refreshRem, 300);
            }, false);
            win.addEventListener('pageshow', function(e) {
                if (e.persisted) {
                    clearTimeout(tid);
                    tid = setTimeout(refreshRem, 300);
                }
            }, false);

            refreshRem();

        })(window);
    </script>
</head>

<body>
    <div id="app"></div>
</body>

</html>