2

ここのgithubのドキュメントを読みました: https://github.com/typekit/webfontloader#custom

そして、html タグに追加される css クラスの使用方法を取得します。しかし、何らかの理由で、フォントがアクティブ モードのときに関数を呼び出す方法がわかりません。

head タグに次のコードがあり、css クラスが追加されています。

 <script>          
      WebFontConfig = {
        custom: {
            families: ['apex_new'],
            urls: ['http://salaam.minnie.mico.dk/wp-content/themes/salaam/style.css']
            active: function () { alert('test'); }
        }
    };
    (function() {
        var wf = document.createElement('script');
        wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
            '://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js';
        wf.type = 'text/javascript';
        wf.async = 'true';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(wf, s);
    })();

jqueryでアクティブモードのときに、アラートボックスまたはconsole.logをポップするにはどうすればよいですか??

ありがとう!!

4

1 に答える 1