我有此svg映射:http://jsfiddle.net/my9bh2xh/
我希望每个图块(状态)都与外部链接链接。
但是,我无法正常工作。我需要做什么?
有什么帮助吗?
一种路径的示例代码:
var kassel = rsr.set();
var kassel = rsr.path("M283.042,133.143l-0.727,4.791l-6.098,0.435l-1.888,3.049 l2.179,1.452l1.742,4.332l-2.178,5.396l-3.63,1.161l-4.21,1.016l-2.178,2.759l-1.742-0.726l-3.193-4.065l-2.179,8.42l-6.242-1.161 l-9.147-0.435l-5.952-4.937c0,0-5.807-0.435-5.807-0.726c0-0.289,0.435-4.5,0.435-4.5l-5.227-3.193l-0.435-5.373l3.339,0.437 l3.049-2.179l0.29-2.758l-2.613-4.646l1.162-6.533l8.42-0.436l10.889,4.064l5.662-2.612l4.501,0.145l6.098,4.791l3.194-0.145 l2.613-3.484l3.629-0.291L283.042,133.143z").attr({fill: '#5d777f',stroke: '#000000',"stroke-miterlimit": '10',parent: 'kassel','stroke-width': '0','stroke-opacity': '1'}).data('id', 'path_i');
kassel.attr({'id': 'kassel','region': 'kassel'}).data({'id': 'kassel', 'region': 'Stadt Kassel'});
regions.push(kassel);
最佳答案
一种方法是只添加如下内容:
.click(function() { window.location='http://www.google.com'; })
到每条路径。