hugo-theme-hyde-hyde/layouts/partials/footer/load-deferred-styles.html
2018-07-27 08:41:33 +10:00

18 lines
682 B
HTML

<script>
var loadDeferredStyles = function () {
var addStylesNode = document.getElementById("deferred-styles");
if (addStylesNode) {
var replacement = document.createElement("div");
replacement.innerHTML = addStylesNode.textContent;
document.body.appendChild(replacement);
addStylesNode.parentElement.removeChild(addStylesNode);
}
};
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
if (raf) raf(function () {
window.setTimeout(loadDeferredStyles, 0);
});
else
window.addEventListener('load', loadDeferredStyles);
</script>