REM is used in the project, results in Oppo and 4.0 some browsers REM is not working properly, Font-size calculated PX is always greater than expected value, so add a hack
var docel = doc.documentelement,
resizeevt = ' orientationchange ' in window? ' Orientationchange ': ' Resize ',
Recalc = function () {
var clientwidth = docel.clientwidth;
if (!clientwidth) return;
docEl.style.fontSize = * (clientwidth/320) + ' px ';
CORRECTPX ()
};
Correction
function Correctpx () {
var docel = document.documentelement;
var clientwidth = docel.clientwidth;
if (!clientwidth) return;
var div = document.createelement (' div ');
Div.style.width = ' 1.4rem ';
Div.style.height = ' 0 ';
Document.body.appendChild (DIV);
var ideal = * CLIENTWIDTH/320;
var RMD = (div.clientwidth/ideal);
if (RMD >1.2)
docEl.style.fontSize = * (clientwidth/320)/Rmd + ' px ';
Document.body.removeChild (DIV);
}
Abort If browser does not support AddEventListener
if (!doc.addeventlistener) return;
Win.addeventlistener (Resizeevt, Recalc, false);
Doc.addeventlistener (' domcontentloaded ', Recalc, false);
An abnormal problem with REM under Android 4.0