Using jQuery to know when @font-face fonts are loaded?

前端 未结 7 2064
日久生厌
日久生厌 2020-11-28 08:35

I am using @font-face and I hate that Firefox shows the default font, waits to load the @font-face font, then replaces it. So the whole page flashes with the new font.

7条回答
  •  迷失自我
    2020-11-28 08:56

    I've got the same problem and I'm trying with the readyfunction(), the bind() function and some others that I found, but none of them works. Finaly I found one solution, just aplying one delay before the animation is loaded... like this:

    $(document).ready(function() {
    
    setTimeout(function (){
       // The animation
    },150);
    
    }); // end ready
    

    I know this is not the best solution, so can someone tell me one better??

    Thanks!

提交回复
热议问题