IE 9 is not rendering images with Raphael JS library

让人想犯罪 __ 提交于 2019-12-11 15:29:33

问题


I am making a Raphael JS animation, and for some reason, I cannot get images to render in internet explorer 9. here is my code:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <link type="text/css" rel="stylesheet" href="css/main.css" />
    <script type="text/javascript" src="scripts/raphael-min.js"></script>
    <script type="text/javascript" src="scripts/jquery-1.7.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
        var layer0 = Raphael("layer0", 980, 650);
        var bg = layer0.image("images/landscape_background.jpg", 0, 0, aniWidth, aniHeight);
    });
    </script>
</head>

<body>
    <div class="layer" id="layer0">
    </div>
    <div class="layer" id="layer1">
    </div>
    <div class="layer" id="layer2">
    </div>
    <div class="layer" id="layer3">
    </div>
    <div class="layer" id="layer4">
    </div>
</body>

</html>

It works fine in chrome and firefox, just not ie 9.


回答1:


You need to put the Raphael Initiator Function around the raphael code to make it work. Eg. raphael(function(){



来源:https://stackoverflow.com/questions/8304299/ie-9-is-not-rendering-images-with-raphael-js-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!