Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/386.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 链接SVG路径_Javascript_Dictionary_Svg_Path_Href - Fatal编程技术网

Javascript 链接SVG路径

Javascript 链接SVG路径,javascript,dictionary,svg,path,href,Javascript,Dictionary,Svg,Path,Href,我有一张svg地图: 我希望每个平铺状态都与外部链接链接。 然而,我不能让它工作。我需要做什么 有什么帮助吗 一条路径的示例代码: 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.7

我有一张svg地图:

我希望每个平铺状态都与外部链接链接。 然而,我不能让它工作。我需要做什么

有什么帮助吗

一条路径的示例代码:

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'; })
每一条路