Created
August 4, 2014 18:04
-
-
Save garystorey/26d707627bbda556d5a6 to your computer and use it in GitHub Desktop.
From Googles PageSpeed Insight - loading css files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cb = function() { | |
| var l = document.createElement('link'); l.rel = 'stylesheet'; | |
| l.href = 'small.css'; | |
| var h = document.getElementsByTagName('head')[0]; h.parentNode.insertBefore(l, h); | |
| }; | |
| var raf = requestAnimationFrame || mozRequestAnimationFrame || | |
| webkitRequestAnimationFrame || msRequestAnimationFrame; | |
| if (raf) raf(cb); | |
| else window.addEventListener('load', cb); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment