perf: postpone initializing site header

Postpone this step to the stage that DOM loaed, but img and css not
This commit is contained in:
jeffreytse 2021-06-28 18:44:37 +08:00
parent 735c2ad48b
commit 4e3e599bbf

View file

@ -56,7 +56,7 @@
</header>
<script>
(function() {
function initHeader() {
var lastScrollY = getScrollPos().y;
var documentElement = document.documentElement;
@ -87,5 +87,6 @@
});
storeScrollData();
})();
}
document.addEventListener('DOMContentLoaded', initHeader);
</script>