zoukankan      html  css  js  c++  java
  • 移动端字体缩放问题解决方案-摘自《html5移动web开发实践》

    <!doctype html>
    <html>
      <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      </head>
      <body>
        <header>
        </header>
        <div>
        <h1>Lorem ipsum</h1>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
        Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </div>
        <footer>
        </footer>
            <script>
              var metas = document.getElementsByTagName('meta');
                var i;
                if (navigator.userAgent.match(/iPhone/i)) {
                    for (i=0; i<metas.length; i++) {
                        if (metas[i].name == "viewport") {
                            metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
                        }
                    }
                    document.addEventListener("gesturestart", gestureStart, false);
                }
                function gestureStart() {
                    for (i=0; i<metas.length; i++) {
                        if (metas[i].name == "viewport") {
                            metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
                        }
                    }
                }
            </script>
      </body>
    </html>
  • 相关阅读:
    全选+批量删除
    ssm异步上传图片
    抽象类与接口区别
    请求转发和重定向区别
    switch
    一道有点绕弯,考察的知识也是最基础的题
    线程安全之集合
    会话跟踪技术
    关于异常说明
    mybatis总结(三)之多表查询
  • 原文地址:https://www.cnblogs.com/beata/p/5736684.html
Copyright © 2011-2022 走看看