English 中文(简体)
Google 字体 API 导致闪烁, jquery 淡化
原标题:Google fonts API causes flicker with jquery fade
  • 时间:2012-05-24 05:54:00
  •  标签:
  • jquery
  • fonts

我使用Google Fonts API在jQuery 1.7.2.

<link href= http://fonts.googleapis.com/css?family=Marmelad  rel= stylesheet  type= text/css >

然后我用 jQuery 来淡出 div, 将第二个 HTML 文件装入 div 中, 并淡出它。 一切正常 。

问题是页面上的任何 Marmelad (我的谷歌字体) 文本都会在淡化转换结束时闪烁。 如果我简单地将相同的 Marmelad 文本修改为 Arial 或其它股票字体, 闪烁不会发生 。

有人知道怎么解决这个问题吗?

这就是我如何淡出 /在div。

jQuery("#clickme").click(function() { 
jQuery( #secondarybox ).fadeOut( fast , function() {   
jQuery( #secondarybox ).load( nextstep.html , function() { 
jQuery( #secondarybox ).fadeIn( slow ); }); }); 
});

但若我使用谷歌Font(Google Font), 所有文字都闪烁,

问题回答

这帮助了我:

$( .slider_container ).fadeIn(function(){
    this.style.removeAttribute("filter");
});

这是只有IE才能解决的 我和Chrome的问题一样





相关问题
Java (AWT): fitting text in a box

I have an application that extends a Frame. Then, it ll display a few lines of text using: Font f = new Font("Arial", Font.PLAIN, 10); g.setFont(f); g.drawString("Test|great Yes ^.", x, y + 10); Now ...

Embed font into PDF file by using iText

I defined a tag map, and got a XML data file. I want to convert the XML data file to PDF by using iText. The question is how to embed fonts (e.g. Polish font, Chinese font) into the target PDF when ...

Font Rendering between Mozilla and webkit

I m not sure if this has anything to do with the recent Safari update, but I m beginning to notice this a lot. There is a drastic difference in the way each browser is rendering fonts. for instance, ...

Embedding Fonts in AS3 - Dynamic Text Field disappears

This is hopefully a new problem or just me missing something obvious. Please help! I m embedding a font into my AS3 application. I m doing everything by-the-book and it half-works. In my main class, ...

Dynamic GD image width text

I m trying to spice up my website by using custom fonts for headings. For me, the most appropriate way to do this is using PHP and GD. I have written a little script which will output the dynamic text ...

How do I combine @font-face and @media declarations?

I d like to build a common typography stylesheet with a very small number of selectors. As such, I d far prefer to use @media sections for the various versions rather than create different files, each ...

热门标签