我试图在我的网站上阻止 FOUC。到目前为止,这是我的代码:
<head>
<!--[if lte IE 8]><script src="js/html5shiv.js"></script><![endif]-->
<script src="js/jquery.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-xlarge.css" />
</noscript>
<style type="text/css">
.no-fouc {display: none;}
</style>
<script type="text/javascript">
document.documentElement.className = 'no-fouc';
$(document).ready(function() {
$('.no-fouc').removeClass('no-fouc');
});
</script>
</head>
我在哪里错了?我仍然得到大约 1-2 秒的 FOUC。
谢谢
杰森