jQuery working out wrong height, due to @font-face

前端 未结 3 1867
刺人心
刺人心 2021-01-04 13:14

I have a problem with jQuery and @font-face.

I need to work out the height of a

, which works fine, but then there is a small delay for the f
相关标签:
3条回答
  • 2021-01-04 13:46

    You might want to check out the Google Font API (http://code.google.com/apis/webfonts/docs/webfont_loader.html). I believe it dynamically loads the font and fires off a number of events that you can act on (for resizing your 's).

    0 讨论(0)
  • 2021-01-04 13:48

    The perfect solution was, as Adam pointed out, using $(window).load instead of $(document).ready

    $(window).load(function(){  
      $(".column").equalHeights();
    }); 
    
    0 讨论(0)
  • 2021-01-04 13:56

    The Google font api looks like it works as long as you load fonts from google, typekit or ascender. But if you are using something else (e.g. another font downloaded from fontsquirrel) you might want to try something like this to figure out the font being rendered. You may also want to check out this discussion on determining the font being used Changing Body Font-Size based on Font-Family with jQuery

    0 讨论(0)
提交回复
热议问题