• viewport 640宽的做法 针对iphone和安卓单独设置


    <!DOCTYPE html>
    <html lang="ch">
    <head>
    <meta charset="utf-8" />
    <meta HTTP-EQUIV="pragma" CONTENT="no-cache">
    <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <meta HTTP-EQUIV="expires" CONTENT="0">
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="Expires" content="-1" />
    <meta http-equiv="pragram" content="no-cache" />
    
    <base href="http://app.cntcma.com/">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>第二届京津冀协同发展论坛</title><meta name="sharecontent" data-msg-img='http://app.cntcma.com/attachments/image/20141113/20141113205001_32033.png' data-msg-title='第二届京津冀协同发展论坛' data-msg-content='敬请关注' data-msg-callBack='' data-line-img='http://app.cntcma.com/attachments/image/20141113/20141113205001_32033.png' data-line-title='第二届京津冀协同发展论坛' data-line-callBack='' />
    <script type="text/javascript">
    if(/Android (d+.d+)/.test(navigator.userAgent)){
            var version = parseFloat(RegExp.$1);
            if(version>2.3){
                var phoneScale = parseInt(window.screen.width)/640;
                document.write('<meta name="viewport" content="width=640, minimum-scale = '+ phoneScale +', maximum-scale = '+ phoneScale +', target-densitydpi=device-dpi">');
            }else{
                document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
            }
        }else{
            document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
        }
    
    //微信去掉下方刷新栏
        if(RegExp("MicroMessenger").test(navigator.userAgent)){
            document.addEventListener('WeixinJSBridgeReady', function() {
                WeixinJSBridge.call('hideToolbar');
            });
        }    
    </script>

    参考的页面:http://app.cntcma.com/wx/35f4a8d465e6e1edc05f3d8ab658c551.html

    还看见一个鸡贼的东西 

    100%;
    max- 600px;

    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    这个更省事,都不用单独写viewport了

    css动画里面播放完了,不在初始位置,而在最终位置的css规则为

    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;

    要想div高度100%,先得设置 html和body的高度100%

  • 相关阅读:
    Discuz论坛自动发帖机
    C#测试数据库连接是否成功
    JS重写提示框(confirm)
    随笔 选择
    随笔 诚实
    web项目经理手册【1】版本控制流程
    Asp.net多层架构中的变量引用与传递
    ASP.NET跨页面传值技巧总结
    web项目经理手册【3】Code Review
    web项目经理手册【7】项目经理需要铭记在心的话
  • 原文地址:https://www.cnblogs.com/pengchenggang/p/4132887.html
Copyright © 2020-2023  润新知