I have multiple fonts in web site It loads very slowly,I have some jquery functionality I need to load them when the fonts are loaded.
I have tried to call it in
In order to capture the event, you'll need to use a font loader. Sadly, there isn't a cross-browser way of loading the fonts, so I suggest you try the Google WebFont Loader:
var WebFontConfig = {
monotype: { // Fonts.com
projectId: 'YourProjectId'
},
active: function() {
// do something
}
};
(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);
})();