var uaContains = function (key) {
    return navigator.userAgent.toLowerCase().indexOf(key.toLowerCase()) >= 0;
};
// can't just try "Android" as it might catch Windows Phone
var ANDROID = ['Linux', 'Android'].every(uaContains);
// can't just try "iPhone" as it might catch Windows Phone
var IOS = ['(iPhone;', '(iPod touch;', '(iPad;', '(iPod;'].some(uaContains);

var useragent = navigator.userAgent.toLowerCase();
var isWeixin = /micromessenger/i.test(useragent);
if (!IOS) {
    document.getElementById('android').style.display = 'block';
    document.getElementById('ios').style.display = 'none';
}

var androidBTN = document.getElementById('android');
androidBTN.addEventListener('click', function (e) {
    if (isWeixin && ANDROID) {
        document.getElementById('tipDiv').style.display = 'block';
        document.getElementById('tipimg').style.display = 'block';
        document.getElementById('tipDiv').style.height = document.documentElement.scrollHeight + 'px';
    }

});

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
猜你喜欢
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案