Skip to content

Instantly share code, notes, and snippets.

@soulcyon
Last active October 25, 2015 13:58
Show Gist options
  • Save soulcyon/4197124 to your computer and use it in GitHub Desktop.
Save soulcyon/4197124 to your computer and use it in GitHub Desktop.
Google Webfonts - Lazy Loader
WebFontConfig = {
/* Add your desired font family here, its a simple Javascript array */
google: { families: [ 'Ubuntu' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment