當你在用移動端手機QQ或者微信內開啟一個網址,會發現有的網站會提示讓你複製地址到手機瀏覽器裡開啟,讓你用手機瀏覽器開啟這個網站,不能在移動端微信或者QQ內直接開啟。
新增方法:
<?php $conf['qqjump']=1; if(strpos($_SERVER['HTTP_USER_AGENT'], 'QQ/')||strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false && $conf['qqjump']==1){ $siteurl='https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; echo '程式碼區域'; exit; } ?>
新增方案一:
把以下程式碼放到判斷程式碼中程式碼區域位置,一起放到程式的首頁也就是index.php檔案當中。
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>在瀏覽器開啟</title> <style type="text/css"> * {margin:0;padding:0;} a {text-decoration:none;} img {max-width:100%;height:auto;} .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%;width:100%;z-index:100;} .weixin-tip p {text-align:center;margin-top:10%;padding:0 5%;} </style> </head> <body> <div> <p><img src="//ae01.alicdn.com/kf/Hb05e015ac5c64958bb6bb387972b6d38z.png" alt="在瀏覽器開啟" /></p> </div> <script type="text/javascript"> $(window).on("load",function(){ var winHeight = $(window).height(); 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(); } }) </script> </body> </html>
新增方案二:
把以下程式碼放到模板全域性檔案中即可
<html> <head> <meta charset="UTF-8"> <title>請使用瀏覽器開啟</title> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"> <meta content="yes" name="apple-mobile-web-app-capable"> <meta content="black" name="apple-mobile-web-app-status-bar-style"> <meta name="format-detection" content="telephone=no"> <meta content="false" name="twcClient" id="twcClient"> <meta name="aplus-touch" content="1"> <style> body,html {width:100%;height:100%} * {margin:0;padding:0} body {background-color:#fff} #contens {font-weight:bold;margin:-285px 0px 10px;text-align:center;font-size:18px;margin-bottom:125px;} .top-bar-guidance {font-size:15px;color:#fff;height:70%;line-height:1.8;padding-left:20px;padding-top:20px;background:url(//gw.alicdn.com/tfs/TB1eSZaNFXXXXb.XXXXXXXXXXXX-750-234.png) center top/contain no-repeat} .top-bar-guidance .icon-safari {width:25px;height:25px;vertical-align:middle;margin:0 .2em} </style> </head> <body> <div> <p>點選右上角<img src="//gw.alicdn.com/tfs/TB1xwiUNpXXXXaIXXXXXXXXXXXX-55-55.png"> <span id="openm">Safari開啟</span></p> <p>可以繼續瀏覽本站哦~</p> </div> <div id="contens"> 檢測到您正在使用應用內建瀏覽器<br /> 請切換到手機瀏覽器瀏覽-小高教學網!<br /> </div> </html>
新增方案三:
<html> <head> <meta charset="UTF-8"> <title>請使用瀏覽器開啟</title> <meta http-equiv="refresh" content="0; url="https://c.pc.qq.com/middlem.html?pfurl=你得網址"> </head> <body> </body> </html>
最新評論