这是我完美运行的小提琴http://jsfiddle.net/demo_Ashif/tmQ2H/
//
var rsrGroups = [Dist1,Dist2];
for (var i = 0, len = rsrGroups.length; i <= len; i++) {
var el = rsrGroups[i];
el.mouseover(function() {
this.toFront();
this.attr({
cursor: 'pointer',
fill: '#990000',
stroke: '#fff',
'stroke-width': '2'
});
this.animate({
scale: '1.2'
}, 200);
});
el.mouseout(function() {
this.animate({
scale: '1.05'
}, 200);
this.attr({
fill: '#003366'
});
});
el.click(function() {
this.animate({
fill: 'green'
}, 200);
});
}
//
index.html
但是我的页面中没有运行相同的代码。在 Chrome 和 Firefox 中相同。我不明白这个错误。请有人解决它。