<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <title>APP下載</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <style> .wxtip{background: rgba(0,0,0,0.8); text-align: center; position: fixed; left:0; top: 0; width: 100%; height: 100%; z-index: 998; display: none;} .wxtip-icon{width: 52px; height: 67px; background: url(./weixin-tip.png) no-repeat; display: block; position: absolute; right: 20px; top: 20px;} .wxtip-txt{margin-top: 107px; color: #fff; font-size: 16px; line-height: 1.5;} </style> </head> <body> <div class="wxtip" id="JweixinTip"> <span class="wxtip-icon"></span> <p class="wxtip-txt">點擊右上角<br/>選擇在瀏覽器中打開進行下載安裝</p> </div> <script type="text/javascript"> window.onload = function(){ if(isWeiXin()){ var shade = document.getElementById('JweixinTip') shade.style.display = 'block' }else{ var UA = navigator.userAgent,devicesType = "android"; (UA.indexOf("iPhone") > -1 || UA.indexOf("iPad") > -1) && (devicesType = "iPhone"); if(devicesType === "android"){ location.href = "安卓下載地址"; } if(devicesType === "iPhone"){ location.href = "蘋果下載地址"; } } } function isWeiXin(){ var ua = window.navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i) == 'micromessenger'){ return true; }else{ return false; } } </script> </body> </html>