我遇到的问题是不能在IE8中渲染excanvas。这是我初始化画布的地方。
var canvas = document.getElementById("map");
if (typeof (G_vmlCanvasManager) != 'undefined') {
canvas = G_vmlCanvasManager.initElement(canvas);
}
var ctx = canvas.getContext("2d");
ctx.fillStyle = "#656600"; // sets colors of counties
ctx.strokeStyle = "#ff0000";
ctx.flobalAlpha = 0.33; // set transparency
<img name="texasmapofcounties" src=../texas-map-of-counties.jpg"style="position: absolute; height: 719px; width: 800px; left: 0px; top: 0;" alt="map of texas counties" />
<canvas id="map" width="800" height="719" style="position: absolute; left: 0px; top: 0; opacity: 1;"></canvas>
<div id="map_blind" style="position: absolute; height: 719px; width: 800px; left: 0px; top: 0;"></div>
<img name="texasmapofcounties" src="../texas-map-of-counties.jpg" width="800" height="719" border="0" id="texasmapofcounties" usemap="#m_texasmapofcounties" alt="" style="position: absolute; height: 719px; width: 800px; left: 0px; top: 0; -moz-user-select: none; opacity: 0;" />
该网站的目的是,如果德克萨斯州的一个县有一个#34; Famous Tree&#34;在该县,该县是绿色的。然后,用户可以选择县并单击它以获得树的弹出列表。该功能适用于IE7 IE9,FF,Chrome等...它只是IE8和Excanvas无法正常工作。
任何帮助将不胜感激!