admin管理员组

文章数量:1332896

I need to refresh Cufon fonts after getting AJAX data. Unfortunately simple Cufon.refresh() don`t work in IE8. Debugger says, tah the line 1191

sStyle.width = roundedShapeWidth;

has Invalid argument.

How to fix it?

I need to refresh Cufon fonts after getting AJAX data. Unfortunately simple Cufon.refresh() don`t work in IE8. Debugger says, tah the line 1191

sStyle.width = roundedShapeWidth;

has Invalid argument.

How to fix it?

Share Improve this question asked Feb 17, 2010 at 8:52 Krzysztof RomanowskiKrzysztof Romanowski 2,1942 gold badges20 silver badges30 bronze badges 0
Add a ment  | 

2 Answers 2

Reset to default 5

I had the same problem. Not only in Cufon.Refresh but also when Cufon.Now occured. And not only in IE8, but in IE7, IE6 and even in IE9PP. I noticed that I use this code for replecament:

Cufon.replace('h1',{hover: true})('h2',{hover: true})('h3',{hover: true})('cite',{hover: true})('.cufon',{hover: true});

The ('.cufon',{hover: true}); part was the one which generated the error. I spent two days to find out, how it could raise an error...

I opened CSS, looked for .cufon sytling. There was no .cufon in CSS. And cufon didn't inherit styles in IE series, insted an error occured.

So I added this to my CSS:

.cufon { }

and error went away.

(Using Cufon 1.09)

I had the same problem and I just reused Cufon.replace instead:

Cufon.replace('h1',{fontFamily: 'StackOverflow'});

Only inconvenient I see is that if you want to refresh all contents, you need to re-list them all:

Cufon.replace('h1, h2',{fontFamily: 'StackOverflow'});
Cufon.replace('h3', { fontFamily: 'StackOverflow Light'});

本文标签: javascriptCufonrefresh() dont work in IE8Stack Overflow