a new start
This commit is contained in:
38
_includes/scripts/cssrelpreload.min.js
vendored
Normal file
38
_includes/scripts/cssrelpreload.min.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
!(function (a) {
|
||||
if (a.loadCSS) {
|
||||
var b = (loadCSS.relpreload = {});
|
||||
if (
|
||||
((b.support = function () {
|
||||
try {
|
||||
return a.document.createElement("link").relList.supports("preload");
|
||||
} catch (b) {
|
||||
return !1;
|
||||
}
|
||||
}),
|
||||
(b.poly = function () {
|
||||
for (
|
||||
var b = a.document.getElementsByTagName("link"), c = 0;
|
||||
c < b.length;
|
||||
c++
|
||||
) {
|
||||
var d = b[c];
|
||||
"preload" === d.rel &&
|
||||
"style" === d.getAttribute("as") &&
|
||||
(a.loadCSS(d.href, d, d.getAttribute("media")), (d.rel = null));
|
||||
}
|
||||
}),
|
||||
!b.support())
|
||||
) {
|
||||
b.poly();
|
||||
var c = a.setInterval(b.poly, 300);
|
||||
a.addEventListener &&
|
||||
a.addEventListener("load", function () {
|
||||
b.poly(), a.clearInterval(c);
|
||||
}),
|
||||
a.attachEvent &&
|
||||
a.attachEvent("onload", function () {
|
||||
a.clearInterval(c);
|
||||
});
|
||||
}
|
||||
}
|
||||
})(this);
|
||||
Reference in New Issue
Block a user