Answer the question
In order to leave comments, you need to log in
How to collect 3 files in one js?
there is such a code to draw an interactive map using Raphael:
it is in the init.js file
$(function(){
var wmap = Raphael('map', 1200, 1000),
attributes = {
fill: '#acacac',
stroke: '#fff',
'stroke-width': 1,
'stroke-linejoin': 'round'
},
arr = new Array();
for (var country in info.provinces) {
var province = wmap.path(info.provinces[country].border);
province.attr(attributes);
arr[province.id] = country;
province
.hover(function(){
this.animate({
fill: '#1669AD'
}, 10);
}, function(){
this.animate({
fill: attributes.fill
}, 10);
})
.click(function(){
document.location.hash = arr[this.id];
var point = this.getBBox(0);
$('#map').next('.point').remove();
$('#map').after($('<div />').addClass('point'));
$('.point')
.html(info.provinces[arr[this.id]].name)
.fadeIn();
});
}
});
Answer the question
In order to leave comments, you need to log in
The info
variable is overridden , so you can do this:
<script src='http://cw1.worldoftanks.ru/static/551254/wgcw/regions/reg_01/map.js'></script>
<script>var info1 = info;</script>
<script src='http://cw1.worldoftanks.ru/static/551254/wgcw/regions/reg_02/map.js'></script>
<script>var info2 = info;</script>
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question