(function(doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function() {
var clientWidth = docEl.clientWidth;
if(!clientWidth) return;
docEl.style.fontSize = (clientWidth >= 720 ? 100 : clientWidth / 7.5) + 'px';
};
if(!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
为情所困2017-05-16 13:46:41
There is a compromise solution. First, set the display of the body: none;
Then use js to control the timing. After 1 millisecond, the display of the body is block;
setTimeout(showpage,1);
function showpage(){
$('body').css({'display':'block','visibility':'visible'})
}
The disadvantage is that when loading, there will be a white screen for one millisecond without jitter. 1 millisecond is considered very short. If you don’t mind, you can try it.