IE 9无法使用Raphael JS库渲染图像 [英] IE 9 is not rendering images with Raphael JS library
本文介绍了IE 9无法使用Raphael JS库渲染图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在制作Raphael JS动画,由于某种原因,我无法在Internet Explorer 9中渲染图像.这是我的代码:
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>
它在chrome和firefox中都可以正常工作,但不是9.
It works fine in chrome and firefox, just not ie 9.
推荐答案
您需要将Raphael Initiator Function放在raphael代码周围,以使其起作用.例如.
raphael(function(){
You need to put the Raphael Initiator Function around the raphael code to make it work. Eg.
raphael(function(){
这篇关于IE 9无法使用Raphael JS库渲染图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文