$('.iosKJ-btn').hide(); $('.iosKJ').hide(); $('.iosKJ-safari').hide(); } else { //pc端 }; } function myBrowser(){ var ua = navigator.userAgent.toLowerCase(); //判断是不是在iPhone的Safair浏览器打开的本页面 if (ua.indexOf('applewebkit') > -1 && ua.indexOf('mobile') > -1 && ua.indexOf('safari') > -1 && ua.indexOf('linux') === -1 && ua.indexOf('android') === -1 && ua.indexOf('chrome') === -1 && ua.indexOf('ios') === -1 && ua.indexOf('browser') === -1) { return "Safari"; } else { //alert("请使用iPhone中的Safari浏览器打开本页面!"); return "noSafari"; } } //非safari $('.iosKJ-safari').click(function(){ $('.iosKJ_nosafsai').show(); }) //关闭 $('.close_safari').on("click",function(){ $('.iosKJ_nosafsai').hide(); }) //复制地址 var clipboard = new Clipboard('.btn'); clipboard.on('success', function(e){ $(".fuzhi_ts").show() document.getElementById('copy_zt').innerHTML = '复制成功'; document.getElementById('taokouling').blur(); setTimeout(function(){ $(".fuzhi_ts").hide() $(".iosKJ").hide() },2000) }); clipboard.on('error', function(e){ document.getElementById('copy_zt').innerHTML = '复制失败,请长按复制'; setTimeout(function(){ $(".fuzhi_ts").hide() $(".iosKJ").hide() },2000) }); //复制地址 end //快捷方式打开 if(("standalone" in window.navigator) && window.navigator.standalone){ // If you want to prevent remote links in standalone web apps opening Mobile Safari, change 'remotes' to true var noddy, remotes = false; $(".quwangapptg").hide(); $('#safari').hide() $('.iosKJ-btn').hide(); $('.iosKJ').hide(); $('.iosKJ-safari').css("display","none"); document.addEventListener('click', function(event) { noddy = event.target; // Bubble up until we hit link or top HTML element. Warning: BODY element is not compulsory so better to stop on HTML while(noddy.nodeName !== "A" && noddy.nodeName !== "HTML") { noddy = noddy.parentNode; } if('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf(document.location.host) !== -1 || remotes)) { event.preventDefault(); document.location.href = noddy.href; } },false); }