Search code examples
javascriptfontscufon

Cufon.refresh() don`t work in IE8


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?


Solution

  • 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)