Last active
September 17, 2015 03:11
-
-
Save teledirigido/7a07c382c068a6c19a19 to your computer and use it in GitHub Desktop.
Font loader
This file contains 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
/* | |
Webfontloader | |
------------- | |
Based on: https://github.com/typekit/webfontloader#typekit | |
DESCRIPTION | |
----------- | |
Load multiple fonts asynchronously using Webfontloader | |
USAGE | |
----- | |
custom_fonts.init(); | |
*/ | |
var custom_fonts = { | |
init: function(){ | |
WebFontConfig = { | |
typekit: { | |
id: 'xxxx' | |
}, | |
google: { | |
families: ['Montserrat'] | |
}, | |
active: function(){ | |
/* | |
Callback for when your fonts has been loaded | |
EXAMPLE | |
------- | |
$('.myfonts').addClass('loaded'); | |
*/ | |
} | |
}; | |
// Add your fonts asynchronously | |
(function(d) { | |
var wf = d.createElement('script'), s = d.scripts[0]; | |
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js'; | |
s.parentNode.insertBefore(wf, s); | |
})(document); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment