Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/448.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.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_Jquery_Arrays_Svg_Raphael - Fatal编程技术网

Javascript 检测是否单击了多个SVG路径

Javascript 检测是否单击了多个SVG路径,javascript,jquery,arrays,svg,raphael,Javascript,Jquery,Arrays,Svg,Raphael,谁能帮我做这个。。。基本上,我需要检测数组中是否单击了任何SVG路径(来自Raphael JS),如下所示: var myArray = [path_ur,path_us,path_ut]; myArray.bind('click',function() { alert('clicked'); }); 如果您有jQuery,请使用它 $.each(myArray, function() { $(this).on('click', function() { ale

谁能帮我做这个。。。基本上,我需要检测数组中是否单击了任何SVG路径(来自Raphael JS),如下所示:

var myArray = [path_ur,path_us,path_ut];

myArray.bind('click',function() {
     alert('clicked');
}); 

如果您有jQuery,请使用它

$.each(myArray, function() {
    $(this).on('click', function() {
     alert('clicked');
    })
}); 

太好了,谢谢!数组是我的一个弱点,我必须解决它:)