var dpr = 1, uagent = window.navigator.useragent; var isios = uagent.match(/iphone/i); var isyixin = uagent.match(/yixin/i); var is2345 = uagent.match(/mb2345/i); var ishaosou = uagent.match(/mso_app/i); var issogou = uagent.match(/sogoumobilebrowser/ig); var isliebao = uagent.match(/liebaofast/i); var isgnbr = uagent.match(/gnbr/i); function resizeroot(){ var wwidth = (screen.width > 0) ? (window.innerwidth >= screen.width || window.innerwidth == 0) ? screen.width : window.innerwidth : window.innerwidth, wdpr, wfsize; var wheight = (screen.height > 0) ? (window.innerheight >= screen.height || window.innerheight == 0) ? screen.height : window.innerheight : window.innerheight; if (window.devicepixelratio) { wdpr = window.devicepixelratio; } else { wdpr = isios ? wwidth > 818 ? 3 : wwidth > 480 ? 2 : 1 : 1; } if(isios) { wwidth = screen.width; wheight = screen.height; } // if(window.orientation==90||window.orientation==-90){ // wwidth = wheight; // }else if((window.orientation==180||window.orientation==0)){ // } if(wwidth > wheight){ wwidth = wheight; } wfsize = wwidth > 1080 ? 144 : wwidth / 7.5; wfsize = wfsize > 32 ? wfsize : 32; window.screenwidth_ = wwidth; if(isyixin || is2345 || ishaosou || issogou || isliebao || isgnbr){ settimeout(function(){ wwidth = (screen.width > 0) ? (window.innerwidth >= screen.width || window.innerwidth == 0) ? screen.width : window.innerwidth : window.innerwidth; wheight = (screen.height > 0) ? (window.innerheight >= screen.height || window.innerheight == 0) ? screen.height : window.innerheight : window.innerheight; wfsize = wwidth > 1080 ? 144 : wwidth / 7.5; wfsize = wfsize > 32 ? wfsize : 32; // document.getelementsbytagname('html')[0].dataset.dpr = wdpr; document.getelementsbytagname('html')[0].style.fontsize = wfsize + 'px'; },500); }else{ // document.getelementsbytagname('html')[0].dataset.dpr = wdpr; document.getelementsbytagname('html')[0].style.fontsize = wfsize + 'px'; } }