移动端H5识别微信赛车平台修复

一、如果是微信浏览器,提示弹出层
微信赛车平台修复【企 娥:217 1793 408】
<div id="JweixinTip">
<img src="../images/weixin.png">
</div>

var ua = navigator.userAgent;
var isWeixin = !!/MicroMessenger/i.test(ua);
if(isWeixin){
document.getElementById('JweixinTip').style.display='block';
}

/点击弹出层上任意位置,隐藏弹出层/
document.getElementById('JweixinTip').onclick=function(){
this.style.display='none';
}

4
二、安卓ios

var Terminal = {
// 辨别移动终端类型
platform : function(){
var u = navigator.userAgent, app = navigator.appVersion;
return {
// android终端或者uc浏览器
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
// 是否为iPhone或者QQHD浏览器
iPhone: u.indexOf('iPhone') > -1 ,
// 是否iPad
iPad: u.indexOf('iPad') > -1
};
}()
根据不同设备跳转不同的链接地址:
if(Terminal.platform.iPhone){ //此处为ios更改下载地址,安卓及浏览器等使用安卓的下载地址
}
window.open(theUrl);

猜你喜欢

转载自blog.51cto.com/13927917/2161234