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>

最佳答案

固定:

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


或添加

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


见这里link

关于javascript - Cufon脚本在IE9下不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12177932/

10-11 03:04