zoukankan      html  css  js  c++  java
  • 如何用js去判断当前是否在微信中打开的链接页面

    function is_weixin() {
                    var ua = navigator.userAgent.toLowerCase();
                    if (ua.match(/MicroMessenger/i) == "micromessenger") {
                        return true;
                    } else {
                        return false;
                    }
                }
    var isWeixin = is_weixin();

    if(isWeixin){
      $(".weixin-tip").css("height",winHeight);
        $(".weixin-tip").show()  ;
        $('.weixin-tip').click(function () {
        $(this).hide()
      });
    }

    顺道写一下打开浏览器引导

    <div class="weixin-tip">
            <p>
              <img class="pic" src="img/live_weixin.png" alt="微信打开"/>
            </p>
    </div>
    
    .weixin-tip{
            display: none; 
            position: fixed; 
            left:0; 
            top:0; 
            bottom:0; 
            background: rgba(0,0,0,0.8); 
            filter:alpha(opacity=80);  
            height: 100%; 
             100%; 
            z-index: 100;
        }
        .weixin-tip p{
            text-align: center; 
            margin-top: 10%; 
            padding:0 5%;
        }
        .pic{
            max- 100%; 
            height: auto;
        }
    

      

  • 相关阅读:
    设计模式的原则
    命令模式
    访问者模式
    策略模式
    外观模式
    组合模式
    原型模式
    合并有序数组
    判断二叉树是否对称
    中序遍历二叉树
  • 原文地址:https://www.cnblogs.com/love314159/p/10120389.html
Copyright © 2011-2022 走看看