// 微信提示
(function (){
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("micromessenger") > -1) { //微信
document.getElementById('download_a').onclick = function (ev) {
var oEvent = ev || event;
oEvent.preventDefault();
document.getElementById('weixinlog').style.display = "block";
}
document.getElementById('download_i').onclick = function (ev) {
var oEvent = ev || event;
oEvent.preventDefault();
document.getElementById('weixinlog').style.display = "block";
}
document.getElementById('sk_app').onclick = function (ev) {
var oEvent = ev || event;
oEvent.preventDefault();
document.getElementById('weixinlog').style.display = "block";
}
document.getElementById('weixinlog').onclick = function (ev) {
this.style.display = "none";
}
}else{
//判断手机并跳转下载连接
if (/iphone|ipad|ipod/.test(ua)) {
setTimeout("javascript:location.href='https://xxx'", 5000);
} else if (/android/.test(ua)) {
setTimeout("javascript:location.href='http://www.xxx'", 5000);
}else {
// pc
}
}
return;
})();
<div id="weixinlog"><img src="http://www.huamufund.com/wp-content/uploads/2016/08/wxlog.png" /></div>