Closed (fixed)
Project:
@font-your-face
Version:
7.x-2.x-dev
Component:
Typekit (provider)
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2013 at 08:38 UTC
Updated:
18 Mar 2013 at 17:50 UTC
Hi,
I am hoping that someone knows the answer, I've been looking for days but I can't find the solution. Basically I need to trigger my own script as soon as the (typekit) font has loaded. Is there any way I can do this outside of 'try{Typekit.load();}catch(e){}'? I have my own jQuery set up in my theme, and now I need to run something in it as soon as 'active' is triggered. My eternal gratitute if someone points me in the right direction!
Cheers,
Dagomar
Comments
Comment #1
sreynen commentedSee http://blog.typekit.com/2010/10/18/more-control-with-typekits-font-events/ toward the bottom. Typekit.load() can take a list of callback functions on different statuses.
Comment #2
dagomar commentedHi sreyen,
Thanks for the follow up. I have seen that piece of code, but when I paste that in my page header for testing purposes, i get no result.
That code does nothing, even though typekit is loading it's fonts (through fontyourface). If I add that code in the module itself instead of 'try{Typekit.load();}catch(e){}', then I do get console.log entries. Any ideas?
Comment #3
sreynen commentedMy guess is the Typekit.load() call in the module causes your call to not work, so you'd need to prevent the first call and make your own. You could do that with hook_js_alter().
Comment #4
dagomar commentedHi sreyen,
I think you're right. I was just wondering if it could be done with javascript, but that is fine. Thanks!
Cheers,
Dagomar