在IE9下,Cufon脚本不起作用

时间:2012-08-29 12:26:02

标签: javascript internet-explorer internet-explorer-9 cufon

Cufon在IE9下不起作用,但只能在兼容模式下正常工作。

有任何解决方法吗?

谢谢!

<!DOCTYPE html>
<html lang="en">
<head>
    <title>@ViewBag.Title - Home</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />

    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    @Styles.Render("~/Content/Site.css")    
    @Scripts.Render("Scripts/jquery-1.6.2.min.js")

    @Scripts.Render("Scripts/cufon-s.js")
    @Scripts.Render("Scripts/Constantia_400-Constantia_700-Constantia_italic_400-Constantia_italic_700.font.js")
    @Scripts.Render("Scripts/Pristina_400.font.js")
    @Scripts.Render("Scripts/Trajan_Pro_400-Trajan_Pro_700.font.js")

    <script type="text/javascript" charset="utf-8">
        $(document).ready(function () {
            Cufon.replace('div.header-sub div.goright ul li, div#menu ul li a', 
            { fontFamily: 'Pristina', hover: true, textShadow: '2px 2px black' })
            ('div#header div.action a', { fontFamily: 'Constantia', hover: true })
            ('ul#sidebar-menu div.action a, h2, h1', { fontFamily: 'Trajan Pro', hover: true });

        });
    </script>
</head>

2 个答案:

答案 0 :(得分:2)

修正:

<!--[if gte IE 9]> <script type="text/javascript"> Cufon.set('engine', 'canvas');   </script> <![endif]-->

或添加

<meta content="IE=8" http-equiv="X-UA-Compatible" /> 

请参阅此处link

答案 1 :(得分:1)

最新版本的cufon脚本适用于IE9。确保安装了v1.09i或更高版本。

从:cufon font

下载