kit
unread,Mar 29, 2009, 4:09:48 PM3/29/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Raphaël
Thanks for your help and suggestions - I've managed to build a superb
wee map of New Zealand, but have encountered one small stumbling
block. This isn't directly related to Raphael, and is more than likely
an issue with IE's javascript interpreter, but hopefully some of you
might have had some experience here. I've appended an onclick and
onmouseover event to the australian map script, which works perfectly
in Firefox, Chrome etc, however these events do not fire in IE. IE
doesn't throw a javascript error either, which makes the problem
difficult to debug. My code is as follows:
<script type="text/javascript" charset="utf-8">
window.onload = function() {
var R = Raphael("paper", 450, 600);
var attr = {
fill: "#3f3f40",
stroke: "#666",
"stroke-width": 1,
"stroke-linejoin": "round"
};
var nz = {};
nz.northland = R.path(attr, "M 193.34222,3.7847503 C
194.65463");
// SVG data stripped for sake of brevity
var current = null;
for (var region in nz) {
nz[region].color = Raphael.getColor();
(function(rg, region) {
rg[0].style.cursor = "pointer";
rg[0].onmouseover = function() {
current && nz[current].animate({ fill:
"#3f3f40", stroke: "#666" }, 500) && (document.getElementById
(current).style.display = "");
rg.animate({ fill: rg.color, stroke:
"#ccc" }, 500);
rg.toFront();
R.safari();
document.getElementById
(region).style.display = "block";
current = region;
};
rg[0].onclick = function() {
alert("IE never gets this far.");
//window.location.href = "my-page.aspx?
District=" + region;
};
rg[0].onmouseout = function() {
rg.animate({ fill: "#3f3f40", stroke:
"#666" }, 500);
};
if (region == "northland") {
rg[0].onmouseover();
}
})(nz[region], region);
}
};
</script>
Any thoughts or suggestions would be greatly appreciated :)