Hello,
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?
Hello,
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 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'});