1.js代码:var checkPlat={
isAndroid: function (ua) {
ua = ua || navigator.userAgent;
return ua.toLowerCase().indexOf(‘android‘) > -1;
},
isIOS: function (platform) {
if (navigator && navigator.platform) {
platform = platform || navigator.platform;
// return /iP(?:hone|od|ad)/.test(platform);
return /iP(?:hone|od|ad)/.test(navigator.userAgent);
} else {
return false;
}
},
isWeixin: function (ua) {
ua = ua || navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
}
}
2.添加跳转的链接
$(function () {
$("#dian_c2").bind("click", function (e) {
var e = e || event, tar = e.target || e.srcElement, s = $(this);
window.location.assign("//要跳转链接");
e.stopPropagation();
});
});